1 reply [Last post]
benopeth
Offline
newbie
Last seen: 11 years 6 weeks ago
Joined: 2006-03-19
Posts: 8
Points: 0

I'm trying to align some boxes, but the problem I'm having is that when I try to adjust the 'margin-right' property, it's not doing anything? All of the others (margin-top, margin-left, etc) are working except this one.

Any help/pointers would be greatly appreciated, since this assignment is due in, in 4 days, argh!

(Here is my CSS file so far...)

#leftspacer {
border-style: none;
background-color: #EDEDED;
margin-left: 200px;
margin-right: 800px;
height: 800px;
width: 50px;
position: absolute;
}

#rightspacer {
border-style: none;
background-color: #EDEDED;
margin-left: 800px;
margin-right: 200px;
height: 800px;
width: 50px;
position: absolute;
}

#header {
border-style: solid;
border-color: #EDEDED;
align: center;
margin-left: 246px;
margin-right: 250px;
height: 150px;
width: 555px;
position: absolute;
background-image: url(images/bullringheader.jpg);
background-repeat: no-repeat;
}

#menu {
border-style: solid;
border-color: #C0C0C0;

width: 250px;
height: 40px;
margin-left: 250px;
margin-right: 360px;
margin-top: 158px;
position: absolute;

}

Anonymous
Anonymous's picture
Guru

'margin-right' isn't doing anything I tell it to?

Laughing out loud I am laughing because I knew what the problem was before I opened the thread. Wink

Position absolute removes the element from the document flow. Margin has no effect on something that is absolutely positioned.

If you need this finished you are going to have to drop the improper use of position: absolute.

Read this: http://www.csscreator.com/css-forum/ftopic13756.html

Then go here: http://www.alistapart.com/articles/holygrail/