CSS: The Basics - ID's and Classes

by Eric McArdle

Css

Cascading Style Sheets

Two types of style sheets: Internal and External

Internal - You insert your style code right into your html code.
These stylesheets should only be used if you are intending to
create a specific page with a specific style. If you want to be
able to make global changes to your website using only one style
sheet, you have to use....

External Stylesheets - Instead of putting all the style code into
your html code, you can create a single document with your css
code and link to it within your webpages code. It would look
something like this


Webpage title< itle> <br><link rel="stylesheet" type="text/css" <br>href="http://www.yourdomain.com/css"> <br></head> <br><br>If you decide to use an internal stylesheet, you have to put your <br>css style wihin the following tags: <br><br><style type="text/css"> <br></style> <br><br>All css or links to the external stylesheets have to go in <br>between the <head> tags <br><br>Now about Css Classes vs. ID's <br><br>The one major difference between a class and an id is that <br>classes can be used multiple times within the same page while an <br>Id can only be used once per page. <br><br>Example: <br><br>ID - The global navigation of your site, or a navigation bar. A <br>footer, header, etc. Only items that appear in only one place <br>per page. <br><br>Class - Anything that you would use multiple times in your page, <br>such as titles, subtitles, headlines, and the like. <br><br>Creating ID 's<br><br>To create an Id in your css, you would start with the number sign <br>(#) and then your label of the id. Here's an example <br> <center><script type="text/javascript"><!-- google_ad_client = "pub-0712857421216240"; google_ad_width = 468; google_ad_height = 60; google_ad_format = "468x60_as"; google_ad_type = "text"; google_ad_channel = ""; google_color_border = "FFFFFF"; google_color_bg = "FFFFFF"; google_color_link = "4F82CB"; google_color_text = "000000"; google_color_url = "000000"; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script></center> <br> <h1>About the author</h1> ="width: 586px; text-align: left"> CSS: The Basics - ID's and Classes   by Eric McArdle Css Cascading Style Sheets Two types of style sheets: Internal and External Internal - You insert your style code right into your html code. These stylesheets should only be used if you are intending to create a specific page with a specific style. If you want to be able to make global changes to your website using only one style sheet, you have to use.... External Stylesheets - Instead of putting all the style code into your html code, you can create a single document with your css code and link to it within your webpages code. It would look something like this Webpage title< itle> If you decide to use an internal stylesheet, you have to put your css style wihin the following tags: All css or links to the external stylesheets have to go in between the tags Now about Css Classes vs. ID's The one major difference between a class and an id is that classes can be used multiple times within the same page while an Id can only be used once per page. Example: ID - The global navigation of your site, or a navigation bar. A footer, header, etc. Only items that appear in only one place per page. Class - Anything that you would use multiple times in your page, such as titles, subtitles, headlines, and the like. Creating ID 's To create an Id in your css, you would start with the number sign (#) and then your label of the id. Here's an example #navigation { float:left; } To insert the id in your html, you would do something like this <!-- google_ad_section_end --> <hr> </div> <!-- content-wrap ends here --></div> <!--footer starts here--> <div id="footer"> <p>© 2003-2007 ArticleBin.com | Last Updated July 7th, 2008 | Design by: <a href="http://www.styleshout.com/">styleshout</a> </p> </div> <!-- wrap ends here --></div> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-1672704-1"; urchinTracker(); </script> </body> </html>