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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DIV Absolute Height Problem

Status
Not open for further replies.

altendew

Programmer
Mar 29, 2005
154
US
Code:
Is below this text
<div style="position:relative">
      <div style="left:0px;top:0px;width:546px;position:absolute">Hey....</div>
      <div style="left:0px;top:20px;width:546px;position:absolute">Going down a little more.</div>
</div>
Overlaps this text

Here is the current code I am working with.

I currently have two absolute division tags placed in a relative tag. There is a problem though. Since they are absoulte it floats and does not aquire a height. Therefor it overlaps the text outside and beneath the relative division tag.

Here is an example of what I mean...

There content overlaps the rest of the page because its absolute.. is there anyway the division tag can aquire the height of the absolute.. Also I can not just specify the CSS height tag because the height is varies and is unknown.
 
Is there any reason you need absolute positioning?

This would work just as fine I would think (and doesn't cause an overlap):
Code:
Is below this text
<div style="position:relative">
      <div style="width:546px;">Hey....</div>
      <div style="width:546px;">Going down a little more.</div>
</div>
Overlaps this text

-kaht

[small] <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <.</B>[/small]
[banghead] [small](He's back)[/small]
 
Yeah I do need it because I made a WYSIWIG in flash and you can place layers anywhere you want.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top