70 likes | 183 Views
Dr. L. Braender: The comment tags will hide the CSS code from older browsers that do recognize Cascading Style Sheets. Browsers and CSS. <HTML> <TITLE>Dr. Bra……</TITLE> <STYLE TYPE=“text/css”> <!- - H1 { color: green} - -> <BODY> … </BODY> </HTML>. Dr. L. Braender:
E N D
Dr. L. Braender: The comment tags will hide the CSS code from older browsers that do recognize Cascading Style Sheets. Browsers and CSS <HTML> <TITLE>Dr. Bra……</TITLE> <STYLE TYPE=“text/css”> <!- - H1 { color: green} - -> <BODY> … </BODY> </HTML> Dr. L. Braender: The style type allows for the possibility of new formatting standards in the future.
CSS Inheritance HTML TITLE BODY H1 P UL LI LI LI
Anatomy of a Rule Selector Property Value H1 { color: darkslateblue } Declaration
Declaration Styles .name { position: absolute; ... font-family: ”Arial"; } All declarations must be contained within the pair of curly braces. A semi-colon separates the declaration and may - but doesn’t have to - also appear at the end of the last declaration. Also, to make your code easier to read, place each declaration on its own line.
Grouping Selectors H1 { font-weight: bold } H2 { font-weight: bold } H3 { font-weight: bold } or H1, H2, H3 { font-weight: bold }
Grouping Selectors H1, H2, H3 { color: darkslateblue; font-weight: demi-bold; font-family: ”Arial"; } H1 { font-size: 36px;} H2 { font-size: 30px;}
Overriding Inheritance <STYLE TYPE=“text/css”> BODY { color=“darkgray; background=“white”; } H1 { color=“lightgrey”; background=“red”;} </STYLE>