The Ten Most Important CSS Tips

 In CSS, Top Tips, Web Design, Web Development

When you’re first learning to build a Web site, you often don’t think much about style sheets, as you’re too busy learning to tell a <p> from a <br>. But once you’ve mastered the basics, CSS is an obvious place to go to make your pages more user friendly and manageable. These ten tips will get you up and running with CSS faster than you might think.

  1. The best way to learn CSS is in a free class.
  2. You can use CSS on more than just span and div tags.
 Make sure that you style everything that makes sense in your document, don’t just limit yourself to span and div tags. I have seen many new CSS developers spend a lot of time trying to convert their sites to span and divs, when it’s not necessary. You can style any tag you need to.
  3. Know the difference between a style class and id.
 Classes can apply to multiple elements on the Web page, while IDs refer to only one element.
  4. Make sure that you name your classes and ids correctly. 
CSS does not allow class and id names to start with a number or other non-alphabetical character.
  5. Style the larger elements first. 
When you style a page, think about first the entire page <html> and <body> and then the larger elements like <p> and so on.
  6. In fact, you should consider giving all your pages the style of html,body { margin: 0px; padding: 0px; border: 0px; }. Then you have a standard palette to work from.
  7. Learn how to style your body tag.
 Avoid having anything special in your <body> tag. That way you can have a more standards-compliant page.
  8. Stay out of trouble. 
Memorise that mnemonic to use borders and padding effectively with your CSS styles.
  9. Do your best to understand CSS positioning before you attempt a layout.
  10. And finally, if you want to read more Cascading Style Sheets tips, receive a tip a day for over 30 days with the Think1Marketing’s CSS Tips Newsletter.
Recommended Posts