The Open Source Swiss Army Knife

/web_design/sample_sheets/
/web_design/sample_sheets/ + sub-categories
http://www.sirfsup.com/
web directory content
    
      

Not logged in
Chat Register Login
return to:  http:/www.sirfsup.com      /web_design   /sample_sheets 
Permalink: inclusion.htm
Title: add
article options : please login   |  print view

Including Your Style Sheet in Your Html Page

Including the style information stored in the css sheet can be done in multiple ways:
1. <LINK> inside <HEAD>
<HEAD>
<LINK REL=STYLESHEET TYPE="text/css" HREF="http://...">

</HEAD>

2. In the <STYLE> element inside <HEAD>
<HEAD>
<style>put style declarations here
</style>

</HEAD>

3. Directly in the STYLE attribute of individual elements of the document.
This method is recommeneded for raw beginners who like to see what results their changes are making to the document formatting. Other people will like to use the class attribute to differentiate.

4. The @import command allows explicit importation.
@import url(http://localhost/style.css)

this example shows four ways to combine style and HTML

    <HTML> <HEAD> <TITLE>title</TITLE>
  1. <LINK REL=STYLESHEET TYPE="text/css" HREF="http://style.com/cool" TITLE="Cool"> <STYLE TYPE="text/css">
  2. @import url(http://style.com/basic);
  3. H1 { color: blue } </STYLE> </HEAD> <BODY> <H1>Headline is blue</H1>
  4. <P STYLE="color: green">While the paragraph is green. </BODY> </HTML>

Leave a Reply
Your Name:     anonymous
Your Email:
Website:  
Comments:

The author will be notified of your reply.
return to top