Call SEO0845 838 7448 SEO RSS Feed

CSS Best Practices: XHTML, Defining Classes, Selectors

Mar 242008

published by Dan in CSS with No Comments

  • Use XHTML - If you are not too familiar with XHTML you can stick to HTML, however, note that by using XHTML you will be ensuring that the website code will not be outdated when HTML is finally phased out. Furthermore using XHTML will allow XML devices to read the code, which is of course a good thing.
  • Define general rules and main classes at the top of the stylesheet - This will help you during coding since it will be much easier for you to make any changes. By inserting general rules and/or main classes anywhere you wish to it will make it harder for you to find the information when you need it.
  • Use the correct selector type - Make sure you know which selector (elements, ids, or classes) should be used. If you don’t choose the one that’s best for the line(s) of code you are generating you may still come up with the same end result but you will end up with a more complex code and larger CSS file. To choose which selector to use keep in mind that while classes can be used on any kind of HTML element you should use the body <body>, paragraphs <p> and heading <h1> elements to define general rules. Furthermore use ids to style only major portions of the web page.


to be continued…

AddThis Social Bookmark ButtonAddThis Feed Button

RSS feed | Trackback URI

Comments »

No comments yet.

Name (required)
E-mail (required - never shown publicly)
URI
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment.

Trackback responses to this post

Web Design | Graphic Design | SEO | SME Website Design | E-commerce Systems | Website Applications | Website maintenance Website Copywriting
Graphic Design | Corporate Identity and Branding | Logo Design | Search Engine Optimisation | Free SEO assessment | Website Design Peterborough | Graphic Design Peterborough Web Design Bolg

© 2007 Doublespark Limited - All rights reserved.

This site is protected by Copyscape