All the articles, all the subjects!
Articles  Articles  Articles

Css: The Basics - Id's And Classes ... Correct


Overall rating: (N/A)

The article "CSS: The Basics - ID's and Classes ... Correct" is about css, it has been created 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 sytlesheets should only be used if you're intending to create a specific page with a specific style.
If you want to be able to make golbal 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 that {head} {title}Webpage title{ itle} {link rel="stylesheet" type="text/css" href="http://www.Yourdomain.Com/css"} {/head} If you decide to use an internal stylesheet, you have to put your css style wihin the following tags: {style type="text/css"} {/style} All css or links to the external stylesheets have to go in between the {head} tags Now abuot 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 appaer 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 strat 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 that {div id="navigation"} {/div} You can also insert an id within another one like that {div id="navigation"} {div id="left} {/div} {/div} Remember to close the id's in order. Now, onto css classes.
Creating Classes To create a class in your css, use that .Subtitle { color: #000000; } To insert the calss into your html, do that {p class="subtitle"} {/p} Now, you can use the same class repeatedly in the same page unlike Id's. I also want to tell you smoething about link attributes.
You should always keep them in that order: a { color: #006699; text-decoration: none; font-size: 100%; } a:link { color: #006699; text-decoration: none; } a:visited { color: #006699; text-decoration: none; } a:hover { color: #0000FF; text-decoration: underline; } a:active { color: #FF0000 } Of course, you can change the colors and text-decorations. This is just something I cut out of my code! Okay, these are the basics.

What I highly recommend is to go and download Topstyle Lite by going here: http://www.Bradsoft.Com opstyle slite/index.Asp It's free and is a really helpful css editor.

It not only color codes and organizes your code, but it provides you with tons of attributes that you can add to your class and id elements with just a click. They also provdie a screen at the bottom to view your css code as you create it. Very useful for a free edition and I'm lokoing to buy the pro version soon. Now, that was just a really very breif explanation of the vital elements needed when structuring your css.
I have a good feeling that when you download top style lite, you will learn how to use the hundreds of attributes in your classes and id's Good Luck in Your Web Dseigning Efforts!
P.S Change { and } to < and >




Write a comment
Write a comment about the article
CSS: The Basics - ID's and Classes ... Correct



Top Articles Searches
Music Business Lessons From The Village People Ezine Advertising Works: Top 10 Reasons To Advertise With Ezines Increasing Site Traffic Luxury Baby Bedding - What To Look For Before You Buy Archery Fishing Tips and Techniques One Of Cancun's Best What do customers really want? Used Car Buying - 5 Steps To Success After the shot, Trailing Deer Part 1 Woodworking Beginners: Secret Tips To Start Right An Introduction to Glow Sticks Determining Your Online Ad Budget America - Is it in Bible prophecies and what can the USA expect at the second coming of Jesus Christ Specialty Advertising in C-Stores Red Bull and Vodka--What a Pair! Payment Plan Options for Home Treadmills Enjoy Your Vacations with Colorado Ski Vacation Package Buying A Computer: Processor & Memory: Affordability And Performance Buying Tips Most Profitable Adsense Money Making Tip Nokia 7380 Mobile Phone Deals – Exceptional Features at Inimitable Costs


Link To Us! Add to favorites Tell a friend! RSS Feed

Sitemap   Privacy Policy   Terms Of Service