5d838cfe943fbad9e22c9a732d8b5798.ppt
- Количество слайдов: 7
CSS Rule Selector Declaration Block body { font-family: Tahoma, Arial, sans-serif; color: black; background: white; margin: 8 px; } Value Attribute Name CS 142 Lecture Notes: CSS 1
Adding Styles to HTML Separate Stylesheet <head>. . . <link rel="stylesheet" type="text/css" href="my. Styles. css" /> <style type="text/css"> body { font-family: Tahoma, Arial, sans-serif; . . . } </style> </head> <body> Page-Specific Styles. . . <div style=“padding: 2 px; . . . ">. . . </body> Element-Specific. CSS CS 142 Lecture Notes: Styles 2
CSS: HTML: body { font-family: Tahoma, Arial, sans-serif; font-size: 13 px; color: black; background: white; margin: 8 px; } h 1 { font-size: 19 px; margin-top: 15 px; margin-bottom: 5 px; border-bottom: 1 px solid black }. shaded { background: #d 0 d 0 ff; } <body> <h 1>First Section Heading</h 1> <p> Here is the first paragraph, containing text that really doesn't have any use or meaning; it just prattles on and on, with no end whatsoever, no point to make, really no purpose for existence at all. </p> <div class="shaded"> <h 1>Another Section Heading</h 1> <p> Another paragraph. </p> </div> </body> CS 142 Lecture Notes: CSS 3
CSS Color Specifiers ● Predefined names: white black red … ● 8 -bit hexadecimal intensities for red, green, blue: #ff 0000 R G B ● 0 -255 decimal intensities: rgb(255, 0) R G B ● Percentage intensities: rgb(80%, 100%) R G B CS 142 Lecture Notes: CSS 4
CSS Element Boxes Parent’s background covers margin Border Margin Element Padding Content Padding Element’s background covers padding CS 142 Lecture Notes: CSS 5
CSS Distances 2 px pixels 1 mm millimeters 2 cm centimeters inches 0. 2 in 3 pt printer’s points 2 em, 4 ex other printer’s units CS 142 Lecture Notes: CSS 6
CS 142 Lecture Notes: CSS 7
5d838cfe943fbad9e22c9a732d8b5798.ppt