css| Beginners | Web page
First, in the In-line line
Inline styles are used to directly use the Style property in HTML tags
<p style= "color:red" >text</p>
Set paragraph text red.
But keep in mind that the final HTML should be independent and use the presentation document, so inline styles should be avoided anywhere.
Ii. interior of the Internal
Embedded interior styles used throughout the page inside the head tag, style tags surround styles.
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 strict//en"
"Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >
<title>css example</title>
<style type= "Text/css" >
p {
color:red;
}
A
Color:blue;
}
</style>
...
All paragraph text is red, link blue.
Like inline styles, you should keep the HTML and CSS separate, so we have only the savior left.
Third, external
External styles are used throughout a variety of page sites. It's a standalone CSS file, like the following:
p {
color:red;
}
A
Color:blue;
}
If the above is saved as "webjx.css", the link in the HTML is like this:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 strict//en"
"Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >
<title>css example</title>
<link rel= "stylesheet" type= "Text/css" href= "Webjx.css"/>
...
The next tutorial will talk about other ways of outreach styles, and now it's enough.
From this tutorial, we will follow the above method of experimental code is a good idea, with a text editor to create a new file, save as "Webjx.css" in the HTML directory.
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 strict//en"
"Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >
<title>my the Web page</title>
<link rel= "stylesheet" type= "Text/css" href= "Webjx.css"/>
...
Save HTML file, now linked to CSS, but now CSS is empty, no content will not change the HTML. When you start to learn CSS, you can add code to the CSS file to see the results of the HTML refresh.