Often modify the magento, have encountered element. The style. The priority level is more than style. The CSS. So modify the CSS, no effect. How can make the level beyond element. The style? Want to use! Important

behind CSS attribute value plus! Important. It could have priority over the element. Style

there are three ways you can apply CSS to HTML.

inline
code is as follows:


<P style="color: red" >Text

this will be specified in the paragraph into red.

we suggestion is that the HTML document should be independent and free style, so the inline style no matter under what circumstances should avoid as far as possible. Inside the

code is as follows:


<! PUBLIC DOCTYPE HTML "-///DTD/W3C XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" ><Html> <Head> <Title> CSS Example <Style type="text/CSS" >P {color: red; } a {color: blue; } </style> ...

this will make the page all paragraphs are red, all connections are blue.

like inline style, you should be a separate HTML document and CSS document, the following, our salvation is coming … … Outside the

code is as follows:


p {color: red; } a {color: blue; }

if this document storage is &other Web. Css” , it can connect with the HTML file like this:

  code is as follows:  


<! PUBLIC DOCTYPE HTML "-///DTD/W3C XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >
<Html>
<Head>
<Title> CSS Example
<Link rel="stylesheet" type="text/CSS" href="http://www.jb51.net//web/web.css"/>...

in senior CSS tutorial, we will also see other connection method of external stylesheets, but up to now, this is enough.

want to gain more from this guide, try in your text editor to create a new document, the same directory in the HTML document, save the code for &other; Web. Css” .

now like the following to improve your HTML document:

  code is as follows:  


<! PUBLIC DOCTYPE HTML "-///DTD/W3C XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" ><Html> <Head> <Title> My first web page <Link rel="stylesheet" type="text/CSS" href="http://www.jb51.net//web/web.css"/></head> ...

save the HTML document. Now connect the HTML and CSS, but it's still a blank, what has not changed. Along with the further learning CSS primary guide, you can add or change the CSS document, through refreshes the browser of HTML documents, convenient to see the effect, like we did before.
# 0 - #


This concludes the body part