Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting things to line up

Status
Not open for further replies.

emozley

Technical User
Jan 14, 2003
769
GB
Hi,

I am trying to get the hang of absolute positioning and cannot understand why the square and the line aren't in line with each other even though they have the same vertical positioning?

<div id="Layer1" style="position:absolute; left:187px; top:162px; width:137px; height:85px; z-index:46; background-color: #D8DEF6; layer-background-color: #D8DEF6; border: 1px none #000000;"></div>

<div id="Layer2" style="position:absolute; left:187px; top:162px; width:685px; height:28px; z-index:53">
<hr size="1" noshade class="ruleCopy">
</div>

Any help much appreciated!

Thanks

Ed
 
There could be some margins and padding on the horizontal rule that push it further down. All in all, there is no property called layer-background-color and unless absolutely necessary, absolute positioning should be avoided.
 
you're right looks like there is an offset of 7 pixels.

thanks very much

Ed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top