-
<!—
this morning I attached my first style sheet to the head of an html doc. I’ve been looking at CSS for the last couple of days trying to get my head around how little bits of punctuation like { can layout a whole page.
I tried placing a few css rules into the head of my document but for some reason it didn’t work. I was defining it as a syle for the document. And then I realised that I was missing <!—
What is this <!—? who thought of that as the opener for a CSS document in a header. Someone must have thought “I know we haven’t thrown a ! in with two little -’s, let’s run with it”
There are a few other things to decide like what you’ll call your css, will you put it in the head of the doc or attach it as an external. If you decide to put it in the head (I’veconfused this with the header in the past) that’s when you’ve got to put:
<head>
<style type=”text/css”>
<!—
and then put your css rules here
—>
</style>
</head>
If you are going to attach a CSS externally then this is the code you need to stick in the head:
<link rel = “stylesheet” type=”text/css” href=” cssFileLocation/URL/Filename.css” >
and then in the body of the html just so it knows there is CSS involved you need to open it with:
<body class=”the name of your css file”>
Have to say I am still getting my head around all that CSS can do. But it seems like a really powerful little set of rules
Posted on March 21, 2009
blog comments powered by Disqus