Forum Moderators: not2easy

Message Too Old, No Replies

CSS not working at all

         

Pokerstar

6:03 pm on Jun 18, 2007 (gmt 0)

10+ Year Member



Hello,

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.

SuzyUK

6:52 pm on Jun 18, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello Pokerstar and Welcome to WebmasterWorld!

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>

Pokerstar

7:00 pm on Jun 18, 2007 (gmt 0)

10+ Year Member



Hi SuzyUK

Thank you so much. I have been searching for ages as to what was wrong and cant believe it was a simple ;.

Again thanks so much for your help :)

Pokerstar

7:09 pm on Jun 18, 2007 (gmt 0)

10+ Year Member



Just out of interest, do you know of any good books to learn css?

At the moment i am reading css for dummies, but it seems that it has alot of errors in it.

Thanks again

Milamber

7:43 pm on Jun 18, 2007 (gmt 0)

10+ Year Member



try the w3schools website, it's a good online reference

zazu

9:43 pm on Jun 18, 2007 (gmt 0)

10+ Year Member



A couple of good books I use are:
Intrgrated HTML and CSS by Virginia DeBolt ISBN 9780782143782 (I have sent emails to Virginia and she does reply)

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]

Pokerstar

10:23 am on Jun 19, 2007 (gmt 0)

10+ Year Member



Thanks for all your posts everyone, they have been a great help.

Pokerstar