Forum Moderators: not2easy
Im new to css and need some help really badly.
I am readin a book about css but everytime i try to use it, no effect is displayed in my browser. Can someone please tell me why this is?
I use IE7
here is the BASIC css script i am trying out that doesnt seem to work.
<html>
<head>
<style>
h1 { font-size:16pt color:blue;}
</style>
</head>
<body>
<h1>this headline is blue and 16 pt.</h1>
</body>
</html>
Thanks in advance.
If you're new to CSS you might want to add the CSS Validator [jigsaw.w3.org] to your bookmarks, it's really useful for catching simple parse errors..
In the case above you are simply missing the semi-colon after the first rule, it's really good practice to write your CSS (property: value; pairs) on separate lines to start with and always make sure you put a semi-colon at the end of each line.
It's not strictly necessary after the last line but if you get in the habit of always adding it, it saves errors if you're ever adding extra rules.. we've all been there ;)
so your rule above should look something like this:
<style>
h1 {
font-size:16pt;
color:blue;
}
</style>
Cascading Style Sheets by Molly E Holzschlag ISBN 9780782141849
[edited by: SuzyUK at 10:06 pm (utc) on June 18, 2007]
[edit reason] edited specifics per charter.. [/edit]