Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS absolute positioning Re: absolute positioning

#92206
jstam
Member

To do that the way you want you’d have to declare a width on #tt and assign it a negative left margin of half of that width. For example:


#tt {
border: 1px solid #000000;
color: black;
display: none;
font-size: 48px;
left: 50%;
margin-left: -50px;
margin-top: -30px;
position: absolute;
top: 0;
width: 100px;
}

I added a black border to see the entire element.

More info here: http://www.wpdfd.com/editorial/thebox/deadcentre4.html