background: #990000 (Full Version)

All Forums >> [Web Development] >> Cascading Style Sheets



Message


dawnyy -> background: #990000 (6/15/2006 9:52:00)

Can anyone tell me what the effect of this line is?

I have a maroon backgroud which I want to change to white, and if I remove this line, the maroon goes, but it also moves everything on my page upwards so things are no longer aligned! Does this somehow pull in a file?

I'd appreciate someones help.




Brandon -> RE: background: #990000 (6/15/2006 9:54:47)

If you want to change it to white you can put this.

background-color: #ffffff
or
background: #ffffff




jaybee -> RE: background: #990000 (6/15/2006 9:58:41)

Welcome to Outfront. Brandon is quite correct, you can just change the hex colour but if you post the rest of the line we can probably tell you why everything is moving.




dawnyy -> RE: background: #990000 (6/15/2006 9:59:04)

quote:

background-color: #ffffff


Thats fantastic, thanks for that. You can't explain what the #990000 is doing could you. Just wondering why it affects the alignment.





jaybee -> RE: background: #990000 (6/15/2006 10:00:08)

See above, I need the rest of the line that background bit sits in.




dawnyy -> RE: background: #990000 (6/15/2006 10:01:25)

This is the rest of that block....

div#header {
width: 100%;
margin-bottom: 40px;
background: #990000;
background-color: #ffffff ;
height: 100px;
position: relative;
top: 34px;
}

I'd appreciate it if someone could explain to me why removing the background line makes a difference to the alignment, as it may help me in my learning all this!




jaybee -> RE: background: #990000 (6/15/2006 10:04:27)

quote:

ORIGINAL: dawnyy

This is the rest of that block....

div#header {
width: 100%;
margin-bottom: 40px;
background: #990000;
background-color: #ffffff;
height: 100px;
position: relative;
top: 34px;
}

I'd appreciate it if someone could explain to me why removing the background line makes a difference to the alignment, as it may help me in my learning all this!


Looking at that, if you only removed that bit, including the ; on the end of it then it shouldn't have affected the line up. If however, you left the ; there then that invalidates the entire block and it would affect the entire css from then on, thus affecting the page layout overall.

You have two background lines in there now too so change that to

div#header {
width: 100%;
margin-bottom: 40px;
background-color: #ffffff;
height: 100px;
position: relative;
top: 34px;
}




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.0625