2 replies [Last post]
Mrkay
Mrkay's picture
User offline. Last seen 1 year 36 weeks ago. Offline
newbie
Joined: 2010-09-07
Posts: 2
Points: 3

Hi

Can anyone tell me what is wrong with this css code. I'm trying to position an element to an absolute position within a div but it gets positioned relative to the page.

#navigation
{
width: 1035px;
background:#ededed;
padding-left:5px;
border-bottom:#666666 1px solid;
display:table-cell;
vertical-align:middle;
position:relative;
font-size:11px;
color:#FFFFFF;
}

#navigation .searchBoxButton
{
position:absolute;
display:inline;
top:8px;
left: 995px;
}

Thanks in advance.

Chris..S
Chris..S's picture
User offline. Last seen 5 weeks 5 days ago. Offline
rank Moderator
Moderator
Timezone: GMT+1
Joined: 2005-02-22
Posts: 6078
Points: 173

Position:relative doesn't

Position:relative doesn't work in table cells, from the CSS2.1 Spec:

"The effect of 'position:relative' on table-row-group, table-header-group, table-footer-group, table-row, table-column-group, table-column, table-cell, and table-caption elements is undefined."

Mrkay
Mrkay's picture
User offline. Last seen 1 year 36 weeks ago. Offline
newbie
Joined: 2010-09-07
Posts: 2
Points: 3

Cheers dude (assuming you are

Cheers dude (assuming you are one).