5 replies [Last post]
dwpcss
Offline
newbie
Last seen: 19 years 7 weeks ago
Joined: 2004-04-13
Posts: 8
Points: 0

Hi

I am having problems when using relative divs in CSS

the items on the right keep jumping down to the next line.

i have included an image of what it looks like, i wanted to make it so that the items on the right were aligned with those on the left. the left always stays fixed width but the right is dyamic depending on content.

any suggestions?

Cheers

PS the code is as follows

html, body{
margin:0;
padding:0;
}

#topleft {
position: relative;
width: 180px;
left: 12px;
height: 23px;
z-index: 1;
vertical-align: middle;
background-color: red;
}

#topright {
position: relative;
left: 192px;
height: 23px;
z-index: 2;
vertical-align: middle;
background-color: green;
}
#topleftwhite {
width: 180px;
position: relative;
left: 12px;
height: 23px;
z-index: 3;
vertical-align: middle;
background-color: blue;
}

#toprightblue {
position: relative;
left: 192px;
height: 23px;
z-index: 4;
vertical-align: middle;
background-color: orange;
}

#leftmenu {
position: relative;
left: 12px;
width: 180px;
height: 23px;
z-index: 5;
vertical-align: middle;
background-color: pink;
}

#rightcontent {
position: relative;
left: 192px;
height: 23px;
z-index: 6;
vertical-align: middle;
background-color: yellow;
}

#whitebottomleft {
position: relative;
width: 180px;
left: 12px;
height: 23px;
z-index: 7;
vertical-align: middle;
background-color: gray;
}

#bluerightbottom {
position: relative;
left: 192px;
height: 23px;
z-index: 8;
vertical-align: middle;
background-color: black;
}

#blueleftbottom {
position: relative;
width: 180px;
left: 12px;
height: 23px;
z-index: 9;
vertical-align: middle;
background-color: #FF33FF;

}

#whiterightbottom {
position: relative;
left: 192px;
height: 23px;
z-index: 10;
vertical-align: middle;
background-color: #996600;
}

HTML

<div id="topleft">topleft</div>
<div id="topright">middletop</div>
<div id="topleftwhite">tleftcorner</div>
<div id="toprightblue">bluetop</div>
<div id="leftmenu">menu</div>
<div id="rightcontent"> content goes here content goes here content goes here content goes here content goes here content goes here content goes here content goes here content goes here content goes here content goes here </div>
<div id="whitebottomleft">bleftcorner</div>
<div id="bluerightbottom">bluebottom</div>
<div id="blueleftbottom">bottomleft</div>
<div id="whiterightbottom">middlebottom</div>

ClevaTreva
ClevaTreva's picture
Offline
Guru
A hilly place, UK
Last seen: 4 years 30 weeks ago
A hilly place, UK
Joined: 2004-02-05
Posts: 2902
Points: 0

alignment problems when using relative

Hi

Can we see this in a url, rather than looking at long lists of code? It is often so easy to spot once you see the page working.

Trevor

dwpcss
Offline
newbie
Last seen: 19 years 7 weeks ago
Joined: 2004-04-13
Posts: 8
Points: 0

alignment problems when using relative

sorry, i cant give out the url as its on a secure server which needs a password.

cheers

ClevaTreva
ClevaTreva's picture
Offline
Guru
A hilly place, UK
Last seen: 4 years 30 weeks ago
A hilly place, UK
Joined: 2004-02-05
Posts: 2902
Points: 0

Re: alignment problems when using relative

dwpcss wrote:
i have included an image of what it looks like

Hi

OK, I can see that asecure server is a problem (have you got a personal space with your isp?).

The image wasn't attached either.

Trevor

dwpcss
Offline
newbie
Last seen: 19 years 7 weeks ago
Joined: 2004-04-13
Posts: 8
Points: 0

alignment problems when using relative

sorry dont have personal space i can upload it to ;o(

i think i have managed to get it sorted now as it works in IE so i can just use one CSS for ie and one for the others.

Thanks for your help though.

Cheers

darrin365
Offline
newbie
Tennessee
Last seen: 19 years 6 weeks ago
Tennessee
Joined: 2004-04-20
Posts: 4
Points: 0

alignment problems when using relative

I can give you the URL to my site. Similar problem. 3-Column setup. The center column is set relative and set to be able to stack. But it's also dropping down.

http://www.dickeyfamily.com