CSS in Webpages
February 8, 2010
For some of you, this may sound like a real lame article. But you ought to give it a chance because I don’t write about stuff you’ll never use! I avoid marginal, nerd centric ivory tower blather like a cat avoids water.
I’ve read hundreds (sadly, this is true) of those 2-inch thick nerd books (I don’t get out much) and I can’t stand it when people waste paper on that kind of generally useless stuff. So read on, eager student, and you will be well on your way to building your own killer web sites! 🙂
The wise people who created CSS came up with 3 basic ways for you to use CSS in your web pages:
1. With an external file that you link to in your web page:
<link href="myCSSfile.css" rel="stylesheet" type="text/css"> |
or using the import method:
<style type="text/css" media="all"> @import "myCSSfile.css"; </style> |
Why use the import method versus the link method when using external style sheets? Use the import method if you want to support really old browsers like Netscape 4.0.
Read the rest of the 3 ways to add CSS code to your web pages.
Thanks,
Stefan Mischook