Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

Class notes 4310702

Rating
-
Sold
-
Pages
14
Uploaded on
01-03-2025
Written in
2024/2025

Lecture notes of 14 pages for the course 4310702 at UoN (basics in css)

Institution
Course

Content preview

CSS Box Model
The CSS box model is a box that wraps around every HTML element. It consists of content,
padding, borders, and margins.
The following diagram illustrates the box model.




Properties of the Box Model
There are several properties in the CSS box model. They are as mentioned below:
Content
The content area consists of content like images, text, or other forms of media content. The
height and width properties help to modify the box dimensions.
Padding
The padding area is the space around the content area and within the border-box. It can be
applied to all sides of the box or to the specific, selected side(s) - top, right, bottom, and/or left.
Border

, The border area surrounds the padding and the content and can be applied to all the sides of the
box or selected side(s) - top, right, bottom, and/or left.
Margin
The margin area consists of space between the border and the margin. The margin does not
possess its background color and is completely transparent. It shows the background color of the
element, like the body element.


CSS Inheritance
●​ CSS inheritance is a mechanism where properties are passed from parent elements to
child elements.
●​ Child elements inherit the styles of their parent elements by default.
●​ You can override inherited styles by applying styles directly to the child elements.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Inheritance</title>
<style>
body {
font-size: 20px;
color: green;
}


.my-element {
font-size: 30px;
}
</style>
</head>
<body>

Written for

Institution
Course

Document information

Uploaded on
March 1, 2025
Number of pages
14
Written in
2024/2025
Type
Class notes
Professor(s)
Wachira
Contains
All classes

Subjects

$8.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
smocharingoz

Also available in package deal

Get to know the seller

Seller avatar
smocharingoz
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
1 year
Number of followers
0
Documents
17
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions