css layout cascading style sheets. lesson overview in this lesson, you will learn: css properties...
TRANSCRIPT
![Page 1: CSS Layout Cascading Style Sheets. Lesson Overview In this lesson, you will learn: CSS properties for margin CSS properties for dimensions (width,](https://reader036.vdocument.in/reader036/viewer/2022082418/5697bfc41a28abf838ca5f2f/html5/thumbnails/1.jpg)
CSS LayoutCascadingStyle Sheets
![Page 2: CSS Layout Cascading Style Sheets. Lesson Overview In this lesson, you will learn: CSS properties for margin CSS properties for dimensions (width,](https://reader036.vdocument.in/reader036/viewer/2022082418/5697bfc41a28abf838ca5f2f/html5/thumbnails/2.jpg)
Lesson OverviewIn this lesson, you will learn:
CSS properties for margin CSS properties for dimensions (width,
height, centering)
![Page 3: CSS Layout Cascading Style Sheets. Lesson Overview In this lesson, you will learn: CSS properties for margin CSS properties for dimensions (width,](https://reader036.vdocument.in/reader036/viewer/2022082418/5697bfc41a28abf838ca5f2f/html5/thumbnails/3.jpg)
Margin PropertiesProperty Description Example Values
margin Margin for all 4 sides:- One value for all 4
sides- In clock-wise order:
Top Right Bottom Left
5px
2px 3px 3px 2px
margin-top, margin-right,margin-bottom,margin-left
Margin for one side of the box
10px
![Page 4: CSS Layout Cascading Style Sheets. Lesson Overview In this lesson, you will learn: CSS properties for margin CSS properties for dimensions (width,](https://reader036.vdocument.in/reader036/viewer/2022082418/5697bfc41a28abf838ca5f2f/html5/thumbnails/4.jpg)
Margin Examples Notice that margins are always transparent (they
don’t contain the elements background color, etc.)
![Page 5: CSS Layout Cascading Style Sheets. Lesson Overview In this lesson, you will learn: CSS properties for margin CSS properties for dimensions (width,](https://reader036.vdocument.in/reader036/viewer/2022082418/5697bfc41a28abf838ca5f2f/html5/thumbnails/5.jpg)
Exercise Open boxes.html and boxstyles.css Apply margins to the boxes so there are
empty spaces between them
![Page 6: CSS Layout Cascading Style Sheets. Lesson Overview In this lesson, you will learn: CSS properties for margin CSS properties for dimensions (width,](https://reader036.vdocument.in/reader036/viewer/2022082418/5697bfc41a28abf838ca5f2f/html5/thumbnails/6.jpg)
CSS properties for dimensions width / height
How wide or tall to make the element Block elements only px or %
![Page 7: CSS Layout Cascading Style Sheets. Lesson Overview In this lesson, you will learn: CSS properties for margin CSS properties for dimensions (width,](https://reader036.vdocument.in/reader036/viewer/2022082418/5697bfc41a28abf838ca5f2f/html5/thumbnails/7.jpg)
Centering a block element
Use auto margins Works best if width is set To center inline elements within a block
element, use text-align: center;
![Page 8: CSS Layout Cascading Style Sheets. Lesson Overview In this lesson, you will learn: CSS properties for margin CSS properties for dimensions (width,](https://reader036.vdocument.in/reader036/viewer/2022082418/5697bfc41a28abf838ca5f2f/html5/thumbnails/8.jpg)
Centering Example
![Page 9: CSS Layout Cascading Style Sheets. Lesson Overview In this lesson, you will learn: CSS properties for margin CSS properties for dimensions (width,](https://reader036.vdocument.in/reader036/viewer/2022082418/5697bfc41a28abf838ca5f2f/html5/thumbnails/9.jpg)
Exercise Open boxes.html and boxstyles.css Center BOX1 Center the text within BOX2, BOX3 and BOX4
![Page 10: CSS Layout Cascading Style Sheets. Lesson Overview In this lesson, you will learn: CSS properties for margin CSS properties for dimensions (width,](https://reader036.vdocument.in/reader036/viewer/2022082418/5697bfc41a28abf838ca5f2f/html5/thumbnails/10.jpg)
Exercise - Solution