Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE background color

Status
Not open for further replies.

skiflyer

Programmer
Sep 24, 2002
2,213
US
I have a very simple css sheet which works beautifully in Mozilla Firebird, but is doing nothing in IE... could someone tell me what's going on here? Thanks.

Code:
body
{
	background-color:slategrey;
}

table
{
	margin:0 auto;
}

-Rob
 
Just guessing here, skiflyer, but I don't think that IE will recognise the colour 'slategrey' written like that as a word.

Try using the hexadecimal number #708090 (that's slategrey on the hexadecimal chart at ).

Might be worth bearing in mind that colours that have then numbers/letters 1,2,4,5,7,8,A,B,D and E in are not colour safe, and may be changed slightly by some browsers in some screen resolutions.

Hope this helps

Luds
 
Yeah, aware of the color safeness, but given the target audience I'm not going for stylistic genius...

You're right about the color though, I had tried red/grey and other words, thinking that'd be good enough... thanks for the tip.

any clue about the margins?

-Rob
 
skiflyer,

for page margins you can go for a general margin

body {margin: 20px;} you can use a % instead of pixels if you want.

or you can be more specific

body {margin-top:20px; margin-bottom:20px; margin-left...; margin-right:....;}
 
But what if I just want it affecting a specific block element, like my table... I thought I had the proper syntax above.

-Rob
 
table {margin: 0px;}
or you can use psuedo classes

table.zero {margin: 0px;}
table.twenty {margin: 20px;}

<table class=&quot;zero&quot;>
<table class=&quot;twenty&quot;>

depending on what you want to use.

Sometimes the Answer You Are LOOKING for can be FOUND BY SEARCHING THE FAQ'S @&%$*#!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top