You should have created an HTML document in the synthesis of the HTML Elementary tutorial, and added a line at the beginning of the CSS Elementary tutorial to associate the HTML document with the CSS document.
The following code includes all the methods we learned in the preliminary tutorial. As long as you save the following as a CSS document and view the HTML document in a browser, you can understand the performance and application of each CSS attribute. The best way is to spend time modifying the code in the CSS and HTML documents, and then check what happened in the browser.
The code is as follows: |
Copy code |
Body { Font-family: arial, helvetica, sans-serif; Font-size: 80%; Color: black; Background-color: # ffc; Margin: 1em; Padding: 0; } /* By the way, this is a comment */ P { Line-height: 1.5em; } H1 { Color: # ffc; Background-color: #900; Font-size: 2em; Margin: 0; Margin-bottom: 0.5em; Padding: 0.25em; Font-style: italic; Text-align: center; Letter-spacing: 0.5em; Border-bottom-style: solid; Border-bottom-width: 0.5em; Border-bottom-color: # c00; } H2 { Color: white; Background-color: #090; Font-size: 1.5em; Margin: 0; Padding: 0.1em; Padding-left: 1em; } H3 { Color: #999; Font-size: 1.25em; } Img { Border-style: dashed; Border-width: 2px; Border-color: # ccc; } A { Text-decoration: none; } Strong { Font-style: italic; Text-transform: uppercase; } Li { Color: #900; Font-style: italic; } Table { Background-color: # ccc; }
|