Log in

View Full Version : Resolved Hello im new to CSS can you check this code?



PSG1JOHN
03-08-2009, 02:43 PM
I cant seem to get my p.important { color: red;} to work in the html its <p class = "important">:confused:
p {
color: blue;

}

Body {
background-color: gray;
font=family: sans-serif;
}

h1 {
border-bottom: 2px double black;
}

h2 {
Color: blue;
font=family: sans-serif;
}
h3.important {
background-color: silver;
color: red;
font=family: sans-serif;
}

ol {
background-color: silver;
color: red;
font=family: sans-serif;
}

q {
color: purple
}


em {
color: aqua;
}

strong{
color: aqua;

{

li {
background-color: silver
color: red;
font=family: sans-serif;
}

p.important {
background-color: silver
color: red;
font=family: sans-serif;

}

p.footer {
background-color: silver
color: black;
font=family: sans-serif;

}

Nile
03-08-2009, 02:44 PM
It should be font-family, not font=family.

Snookerman
03-08-2009, 02:52 PM
There were quite a few errors, this should work:

p {
color: blue;
}
body {
background-color: gray;
font-family: sans-serif;
}
h1 {
border-bottom: 2px double black;
}
h2 {
color: blue;
font-family: sans-serif;
}
h3.important {
background-color: silver;
color: red;
font-family: sans-serif;
}
ol {
background-color: silver;
color: red;
font-family: sans-serif;
}
q {
color: purple;
}
em {
color: aqua;
}
strong {
color: aqua;
}
li {
background-color: silver;
color: red;
font-family: sans-serif;
}
p.important {
background-color: silver;
color: red;
font-family: sans-serif;
}
p.footer {
background-color: silver;
color: black;
font-family: sans-serif;
}
You can run your CSS code though the W3 validator (http://jigsaw.w3.org/css-validator/) to make sure you don't have any errors.

Good luck!

PSG1JOHN
03-08-2009, 02:59 PM
Thanks a lot you guys for the fast reply on help Smookerman and Nile!

Nile
03-08-2009, 03:06 PM
Glad to help you! Your welcome!
It seems your topic is solved... Please set the status to resolved.. To do this:
Go to your first post ->
Edit your first post ->
Click "Go Advanced" ->
Then in the drop down next to the title, select "RESOLVED"

Snookerman
03-08-2009, 03:07 PM
You're welcome, glad to help!
You can go to your first post in this thread, click http://www.dynamicdrive.com/forums/images/buttons/edit.gif then click Go Advanced and add the Resolved prefix to the thread title.
This will let other users know the problem has been solved.

Also, you might be interested in this CSS tutorial: http://www.howtocreate.co.uk/tutorials/css/introduction (http://www.howtocreate.co.uk/tutorials/css/introduction)

Good luck!