View Full Version : css only works "part-time"
Hi, I'm using a css file for my homepage. However, only some of my attributes work. Example:
p: {font-family:"Arial"; font-size:20pt; font-color:#ff0000;}
the first one works, the rest doesn't. The same goes for some <a> and <body> attributes. I tried different ways of spelling like
font-size:"20pt"
font-size: 20pt
size:20pt
etc.
but I just can't get it to work properly. I looked it up in some books but I couldn't find anything.
Has anyone experienced this problem before? Can anyone suggest a solution?
Thanks a lot!
Eddyd84
02-23-2003, 04:13 PM
Be sure to end with semicolons.
body{
font-size: 20pt;
}
:)
redhead
02-23-2003, 04:25 PM
herm... try this:
p {
font-family: arial;
font-size: 20pt;
color:#ff0000;
}
notice that is color, not font-color... does that work now?
@eddy: that's what I thought, too, but semicolons don't really matter (at the end of the line)
@redhead: no, that didnt work either
redhead
02-23-2003, 05:11 PM
well... it does for me.
can you post a little more code so someone can see exactly where you are going wrong, because whats been said should have sorted it
Thanks a lot for all your help, but actually, I just found the problem:
p: {font-family:"Arial"; color:#ff0000; font-size:2pt} // was the code I used
p {font-family:"Arial"; color:#ff0000; font-size:2pt} // would have been the correct code
I guess I just copied this line "a:hover {font-family:"Tahoma"; color:#00CC00; text-decoration:none;}" and thought the ":" was necessary.
... or to quote a well-known yellow guy: "Doh!"
redhead
02-23-2003, 05:41 PM
heh... thats ok, good to see you got it sorted...
ronaldb66
02-24-2003, 09:25 AM
If I may add one thing to that, well, actually two: it's not necessary to enclose a font name in quotes when it's a single word (it does if it's more than one word), and it's good practice to at least add a generic font name, such as serif or sans-serif in case the font specified is not available on the user's computer.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.