CSS troubles
- Started
- Last post
- 34 Responses
- doesnotexist
so im actually taking the time to read up on css and not just do a once over kind of knowing it.
anyways, im trying to do a border, not showing up.
my element is coming through more than once...thought it was only supposed to happen once?
and my backgrounds arent working. here's my css:
body {
background: #FFFFFF;
font-family: Georgia, sans-serif;
font-size: 12px;
margin: 150px;
}.p {font-family: georgia;
font-size: 30px;
font-weight: bold;
}.p2 {font-family: georgia;
font-size: 15px;
font-weight: bold;
color: FF9900
}#container{
width: 10%;
margin: 20px;
border: 5px, solid, 666666;
background: CCCCCC;
font-family: georgia;
color: 666666;
}
- nocomply0
Dude..I think you gotta remove the commas from your border script. So make it looks like this:
"border: 5px solid 666666;"
instead of:
"border: 5px, solid, 666666;"
Seeing your code made me curious about the commas, so I just did a little test myself.
- inkblot0
You should not use commas - and you really should have the color with the # sign.
example: #CCCCCC
(If you dont - it wont show up in some browsers)You should also capitalize your font families, end statement with a ;, etc..
- monNom0
background should be background-colour
pretty sure you need more than one declaration to use background.
eg:
background: #000000 url() no-repeat;
- nocomply0
Yeah sorry for the quick (bad) example. What inkblot said is right. For proper semantics of your code and to make sure your code is read by all browsers, always include a "#" before declaring a color.
- doesnotexist0
aight, so i added the #'s, no luck. and i removed the commas from the border properties...still not showing up. GAH
im on safari osx
- bulletfactory0
link to the page?
- doesnotexist0
uploaded:
- MrWhite0
add a ";" after color: #FF9900
- bulletfactory0
there are some conflicting tags in there..... the body tag has 2 different background color properties - one set w/ background-color: #ffffff and the second with background:#000000 url...
- doesnotexist0
fixed those, still not working. weird.
- MrWhite0
what are you seeing? I am seeing an HTML page that is formatted using the stylesheet. it appears to be correct.
post a screenshot of what you are seeing
- nocomply0
Yeah you got a number of issues going on in there, and the page renders very differently in FireFox and IE.
One thing I'd say is to stay away from using percentages to define width and height whenever possible. That's really just my personal preference, but it makes things a lot easier for me to use pixels. I'm a fan of fixed width layout because they always "work" for me.
- doesnotexist0
thanks? kind of why im asking for help, as i dont understand why it's not working.
- doesnotexist0
hmmm...just tested it on my pc...the borders and background for the element is coming through....why not safari?
- doesnotexist0
ahhhhhh wtf?!?!
i dont see those in dreamweaver...but i replaced what i see on your screen with spaces, IT WORKS!
thanks, dude
- nocomply0
Yes I too see the "?" when I view your CSS in firefox. Perhaps thats the issue at hand. Maybe remove any whitespace characters you think you may have??
- bulletfactory0
glad i could help!