Free Articles, Free Web Content, Reprint Articles
Monday, May 28, 2012
 
Free Articles, Free Web Content, Reprint ArticlesRegisterAll CategoriesTop AuthorsSubmit Article (Article Submission)ContactSubscribe Free Articles, Free Web Content, Reprint Articles
ADVERTISEMENTS
 

CSS: The Basics - ID's and Classes

Css ... Style Sheets Two types of style sheets: Internal and External Internal - You insert your style code right into your html code. These ... should only be used if you are ...

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><br>#navigation { <br>float:left; <br>} <br><br>To insert the id in your html, you would do something like this <br><br><div id="navigation"> <br></div> <br><br>You can also insert an id within another one like this <br><br><div id="navigation"> <br><div id="left"> <br><br></div> <br></div> <br><br>Remember to close the id's in order. <br><br>Now, onto css classes. <br><br>Creating Classes<br><br>To create a class in your css, use this <br><br>.subtitle { <br>color: #000000; <br>} <br><br>To insert the class into your html, do this <br><br><p class="subtitle" <br></p <br><br>Now, you can use the same class repeatedly in the same page <br>unlike Id's. <br><br>I also want to tell you something about link attributes. You <br>should always keep them in this order: <br><br>a { <br>color: #006699; <br>text-decoration: none; <br>font-size: 100%; <br>} <br><br>a:link { <br>color: #006699; <br>text-decoration: none; <br>} <br><br>a:visited { <br>color: #006699; <br>text-decoration: none; <br>} <br><br>a:hover { <br>color: #0000FF; <br>text-decoration: underline; <br>} <br><br>a:active { <br>color: #FF0000 <br>} <br><br>Of course, you can change the colors and text-decorations. This <br>is just something I cut out of my code! <br><br>Okay, these are the basics. What I highly recommend is to go and <br>download Topstyle Lite by going here: <br><br>http://www.bradsoft.com opstyle slite/index.asp <br><br>It's free and is a very helpful css editor. It not only color <br>codes and organizes your code, but it provides you with tons of <br>attributes that you can add to your class and id elements with <br>just a click. They also provide a screen at the bottom to view your <br>css code as you create it. Very useful for a free edition and <br>I'm looking to buy the pro version soon. <br><br>Now, this was just a very very brief explanation of the vital <br>elements needed when structuring your css. I have a good feeling <br>that when you download top style lite<a href="http://www.articlesfactory.com"><img src="http://www.articlesfactory.com/pic/x.gif" alt="Free Web Content" border="0"></a>, you will learn how to use <br>the hundreds of attributes in your classes and id's <br><br>Good Luck in Your Web Designing Efforts! <!-- google_ad_section_end --> <p class="txt-small-regular">Source: <a href="http://www.articlesfactory.com" class="small-link" title="Free Articles">Free Articles</a> from ArticlesFactory.com</p> <table> <tr> <td valign="top"><g:plusone size="medium" count="false"></g:plusone></td> <td valign="top"><div class="fb-like" data-send="false" data-layout="button_count" data-width="450" data-show-faces="false"></div></td> <tr> </table> <p> <h1>ABOUT THE AUTHOR</h1> <br> <div>Eric McArdle is the publisher of the TrafficaZine Online<br>Marketing Newsletter which is a publication designed to<br>assist the online marketing and/or web designing<br>entrepreneur with the basic tools and resources that will<br>greatly assist them in taking further steps into bettering<br>their online business. http://www.trafficazine.com<br></div> </p> <center> <!-- ValueClick Media 300x250 Medium Rectangle CODE for articlesfactory.com --> <script language="javascript" src="http://media.fastclick.net/w/get.media?sid=20894&m=6&tp=8&d=j&t=n"></script> <noscript><a href="http://media.fastclick.net/w/click.here?sid=20894&m=6&c=1" target="_blank"> <img src="http://media.fastclick.net/w/get.media?sid=20894&m=6&tp=8&d=s&c=1" width=300 height=250 border=1></a></noscript> <!-- ValueClick Media 300x250 Medium Rectangle CODE for articlesfactory.com --> </center> <!-- Kontera ContentLink --> <SCRIPT LANGUAGE="JavaScript"> var dc_UnitID = 14; var dc_PublisherID = 3523; var dc_AdLinkColor = '#990000'; var dc_underlineType = 'solid'; var dc_open_new_win = 'yes'; var dc_adprod='ADL'; </SCRIPT> <SCRIPT LANGUAGE="JavaScript" SRC="http://kona.kontera.com/javascript/lib/KonaLibInline.js"></SCRIPT> <!-- Kontera ContentLink --> <br> <br> </div> </td> </tr> <tr> <td width="131" height="24" bgcolor="#EDE9E3" valign="top"> <table width="131" height="24" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td height="24" background="http://www.articlesfactory.com/pic/left_menu_inactive.gif"><a href="http://www.articlesfactory.com/articles/health.html" class="left-menu-inactive">Health</a></td> </tr> <tr> <td height="24" background="http://www.articlesfactory.com/pic/left_menu_inactive.gif"><a href="http://www.articlesfactory.com/articles/business.html" class="left-menu-inactive">Business</a></td> </tr> <tr> <td height="24" background="http://www.articlesfactory.com/pic/left_menu_inactive.gif"><a href="http://www.articlesfactory.com/articles/finance.html" class="left-menu-inactive">Finance</a></td> </tr> <tr> <td height="24" background="http://www.articlesfactory.com/pic/left_menu_inactive.gif"><a href="http://www.articlesfactory.com/articles/travel.html" class="left-menu-inactive">Travel</a></td> </tr> <tr> <td height="24" background="http://www.articlesfactory.com/pic/left_menu_inactive.gif"><a href="http://www.articlesfactory.com/articles/home-repair.html" class="left-menu-inactive">Home Repair</a></td> </tr> <tr> <td height="24" background="http://www.articlesfactory.com/pic/left_menu_inactive.gif"><a href="http://www.articlesfactory.com/articles/technology.html" class="left-menu-inactive">Technology</a></td> </tr> <tr> <td height="24" background="http://www.articlesfactory.com/pic/left_menu_inactive.gif"><a href="http://www.articlesfactory.com/articles/computers.html" class="left-menu-inactive">Computers</a></td> </tr> <tr> <td height="24" background="http://www.articlesfactory.com/pic/left_menu_inactive.gif"><a href="http://www.articlesfactory.com/articles/family.html" class="left-menu-inactive">Family</a></td> </tr> <tr> <td height="24" background="http://www.articlesfactory.com/pic/left_menu_inactive.gif"><a href="http://www.articlesfactory.com/articles/communication.html" class="left-menu-inactive">Communication</a></td> </tr> <tr> <td height="24" background="http://www.articlesfactory.com/pic/left_menu_inactive.gif"><a href="http://www.articlesfactory.com/articles/entertainment.html" class="left-menu-inactive">Entertainment</a></td> </tr> <tr> <td height="24" background="http://www.articlesfactory.com/pic/left_menu_inactive.gif"><a href="http://www.articlesfactory.com/articles/autos.html" class="left-menu-inactive">Autos</a></td> </tr> <tr> <td height="24" background="http://www.articlesfactory.com/pic/left_menu_inactive.gif"><a href="http://www.articlesfactory.com/articles/marketing.html" class="left-menu-inactive">Marketing</a></td> </tr> <tr> <td height="24" background="http://www.articlesfactory.com/pic/left_menu_inactive.gif"><a href="http://www.articlesfactory.com/articles/self-help.html" class="left-menu-inactive">Self Help</a></td> </tr> <tr> <td height="24" background="http://www.articlesfactory.com/pic/left_menu_inactive.gif"><a href="http://www.articlesfactory.com/articles/sports.html" class="left-menu-inactive">Sports</a></td> </tr> <tr> <td height="24" background="http://www.articlesfactory.com/pic/left_menu_inactive.gif"><a href="http://www.articlesfactory.com/articles/home-business.html" class="left-menu-inactive">Home Business</a></td> </tr> <tr> <td height="24" background="http://www.articlesfactory.com/pic/left_menu_inactive.gif"><a href="http://www.articlesfactory.com/articles/education.html" class="left-menu-inactive">Education</a></td> </tr> <tr> <td height="24" background="http://www.articlesfactory.com/pic/left_menu_inactive.gif"><a href="http://www.articlesfactory.com/articles/ecommerce.html" class="left-menu-inactive">ECommerce</a></td> </tr> <tr> <td height="24" background="http://www.articlesfactory.com/pic/left_menu_inactive.gif"><a href="http://www.articlesfactory.com/articles/law.html" class="left-menu-inactive">Law</a></td> </tr> <tr> <td height="24" background="http://www.articlesfactory.com/pic/left_menu_inactive.gif"><a href="http://www.articlesfactory.com/articles/other.html" class="left-menu-inactive">Other</a></td> </tr> <tr> <td height="24" background="http://www.articlesfactory.com/pic/left_menu_inactive.gif"><a href="http://www.articlesfactory.com/articles/internet.html" class="left-menu-inactive">Internet</a></td> </tr> </table> <table width="131" height="11" border="0" cellspacing="0" cellpadding="0" bgcolor="#EDE9E3"> <tr> <td height="11" align="right"><img src="http://www.articlesfactory.com/pic/right_curve.gif" width="12" height="11" alt="" border="0"></td> </tr> </table> <!-- google_ad_section_start(weight=ignore) --> <div class="left-section"><b>Partners</b></div> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="http://www.articlesfactory.com/pic/x.gif" width="15" height="1" alt="" border="0"></td> <td valign="top"><img src="http://www.articlesfactory.com/pic/left_menu_bullet.gif" width="8" height="10" alt="" border="0"></td> <td><div class="left-section-link"><a class="left-section-link" href="http://www.bailfish.com" target="_blank" rel="nofollow">California Bail Bonds Bounty Hunters</a></div></td> </tr> <tr> <td><img src="http://www.articlesfactory.com/pic/x.gif" width="15" height="1" alt="" border="0"></td> <td valign="top"><img src="http://www.articlesfactory.com/pic/left_menu_bullet.gif" width="8" height="10" alt="" border="0"></td> <td><div class="left-section-link"><a class="left-section-link" href="http://www.kateraynor.com" target="_blank" rel="nofollow">Immigration Attorney</a></div></td> </tr> <tr> <td><img src="http://www.articlesfactory.com/pic/x.gif" width="15" height="1" alt="" border="0"></td> <td valign="top"><img src="http://www.articlesfactory.com/pic/left_menu_bullet.gif" width="8" height="10" alt="" border="0"></td> <td><div class="left-section-link"><a class="left-section-link" href="http://www.movingcompanies.tv" target="_blank" rel="nofollow">Moving Relocation Services</a></div></td> </tr> <tr> <td><img src="http://www.articlesfactory.com/pic/x.gif" width="15" height="1" alt="" border="0"></td> <td valign="top"><img src="http://www.articlesfactory.com/pic/left_menu_bullet.gif" width="8" height="10" alt="" border="0"></td> <td><div class="left-section-link"><a class="left-section-link" href="http://www.diyawards.com" target="_blank" rel="nofollow">Crystal Awards and Trophies</a></div></td> </tr> <tr> <td><img src="http://www.articlesfactory.com/pic/x.gif" width="15" height="1" alt="" border="0"></td> <td valign="top"><img src="http://www.articlesfactory.com/pic/left_menu_bullet.gif" width="8" height="10" alt="" border="0"></td> <td><div class="left-section-link"><a class="left-section-link" href="http://janeshilton.co.uk/handbags" target="_blank" rel="nofollow">Handbags</a></div></td> </tr> <tr> <td><img src="http://www.articlesfactory.com/pic/x.gif" width="15" height="1" alt="" border="0"></td> <td valign="top"><img src="http://www.articlesfactory.com/pic/left_menu_bullet.gif" width="8" height="10" alt="" border="0"></td> <td><div class="left-section-link"><a class="left-section-link" href="http://caraudiosecurity.com/shop/home.html" target="_blank" rel="nofollow">Alpine Car Audio</a></div></td> </tr> <tr> <td><img src="http://www.articlesfactory.com/pic/x.gif" width="15" height="1" alt="" border="0"></td> <td valign="top"><img src="http://www.articlesfactory.com/pic/left_menu_bullet.gif" width="8" height="10" alt="" border="0"></td> <td><div class="left-section-link"><a class="left-section-link" href="http://www.citrusfresh.com" target="_blank" rel="nofollow">Carpet Cleaning Los Angeles</a></div></td> </tr> </table> <div align="center"> <script type="text/javascript"><!-- google_ad_client = "ca-pub-0003120597825310"; /* [AF] (120 x 600) */ google_ad_slot = "2900666160"; google_ad_width = 120; google_ad_height = 600; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> </div> <br> <br> <!-- google_ad_section_end(weight=ignore) --> </td> </tr> </table> <table width="750" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td height="50"> <div class="small-link" align="center"> <a class="small-link" href="http://www.articlesfactory.com/">Free Articles Home</a> | <a class="small-link" href="http://www.articlesfactory.com/signup.html">Register</a> | <a class="small-link" href="http://www.articlesfactory.com/submit.html">Submit an Article</a> | <a class="small-link" href="http://www.articlesfactory.com/links.html">Links</a> | <a class="small-link" href="http://www.articlesfactory.com/contact.html">Contact</a> | <a class="small-link" href="http://www.articlesfactory.com/archive.html">Archive</a> | <a class="small-link" href="http://www.articlesfactory.com/rss.html"><img src="http://www.articlesfactory.com/pic/icon-xml-rss_red.gif" width="52" height="13" alt="XML/RSS Feed" border="0" align="middle"></a> </div> <div class="small-link" align="center"> <a class="small-link" href="http://www.articlesfactory.com/terms.html">Terms of Service</a> | <a class="small-link" href="http://www.articlesfactory.com/privacy.html">Privacy Policy</a> </div> </td> </tr> </table> <!-- Start of StatCounter Code --> <script type="text/javascript" language="javascript"> <!-- var sc_project=479039; var sc_invisible=1; var sc_partition=3; var sc_security=""; //--> </script> <script type="text/javascript" language="javascript" src="http://www.statcounter.com/counter/counter.js"></script><noscript><img src="http://c4.statcounter.com/counter.php?sc_project=479039&java=0&security=&invisible=1" alt="free web stats" border="0"></noscript> <!-- End of StatCounter Code --> <!-- Start of Google Analytics Code --> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-88528-1"; urchinTracker(); </script> <!-- End of Google Analytics Code --> <script> //window.resizeTo(1024, 768); //window.resizeTo(800, 600); </script> </body> </html><div class="small" align="center">Page loaded in 0.057 seconds</div>