Click "file" -- select "save" -- select "all files" as the file type -- Enter "dreamdu.html" as the file name and select the file storage address. (You must save the file suffix as. HTML or. htm. Otherwise, the page cannot be displayed)
<3> Create another file and enter the following code (copy it directly)
/* Paragraph style */p{color: purple;font-size: 12px;}/* Title style */h1{color: olive;text-decoration: underline;}/* Link style */a:link{color:#006486;}a:visited{ color:#464646;}a:hover { color: #fff;background: #3080CB;}a:active { color:white;background: #3080CB ;}
Click "file" -- select "save" -- select the file type as "all files" -- input "dreamdu.css" in the file name and select the file storage address. (The suffix of the file must be saved as. CSS, and be in the same directory as dreamdu.html .)
<4> now we can double-click the dreamdu.html file to see the effect.
How is it? Colorful :)
Now let's explain the above example. An HTML file is a text file. an HTML file must be loaded at the head.CSSStyle<link rel="stylesheet" type="text/css" href="dreamdu.css" />.
CSSThe file is also a text file.
p{color: purple;font-size: 12px;}
Indicates that all content contained in the p tag is purple-red.color: purple;, 12px sizefont-size: 12px;.
h1{color: olive;text-decoration: underline;}
Indicates that the content contained in the H1 tag is Olivecolor: olive;, Underlinedtext-decoration: underline;.
a:link{color:#006486;}a:visited{ color:#464646;}a:hover { color: #fff;background: #3080CB;}a:active { color:white;background: #3080CB ;}
It represents the HTML link style, which is a bit complicated. You can check the effect first, in the advanced tutorial, I will analyze the link style (this link style is used by mengzhidu). [For details, refer to http://www.dreamdu.com/style.css].
Several Questions For example, what editor does it use? For more information about how to display the extension, see the example of HTML and XHTML.
From: http://www.dreamdu.com/css/declaration/