There are three ways to apply CSS 1 and In-line
In-row styles use the style attribute directly in html tags.
Text
Set the paragraph text to red.
However, remember that the final HTML should be independent and use the presentation document, so the intra-row style should be avoided anywhere.
Ii. Internal
The embedded internal style used for the entire page is in the head label, and the style label is surrounded by the style.
Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd>
CSS Example
...
The text of all paragraphs is red and the link is blue.
Like in-row Styles, you should keep HTML and CSS separated, so we only have a savior.
Iii. External
External styles are used throughout a variety of web pages. It is an independent CSS file, as shown below:
P {
Color: red;
}
A {
Color: blue;
}
If the token is saved as web.css, the link in the HTML is as follows:
Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd>
CSS Example
...
Other external style methods will be discussed later in the tutorial. It is enough now.
In this tutorial, it will be a good idea to experiment code along the above method. Use a text editor to create a file and save it as "web.css? 6.1.3 "in the html directory.
Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd>
My first web page
...
Save the HTML file. Now CSS is linked, but CSS is empty and NO content will change the HTML. When you start to learn CSS, you can add code to the CSS file to view the HTML refresh results.