Forum Moderators: not2easy
The above is what I need to accomplish; I've been trying for days, and googled way too much, and I can't accomplish the above.
I need the floated area to always be in the bottom right, where there can be 10 or 100 lines of text.
It works perfectly by position absolute on the floated area, and setting it to the bottom right via:
bottom: 0px;
right: 0px;
position: absolute;
and the parent container is position relative, but then the text is overlapped by the 'floated' area.
Any thoughts?
[edited by: Xapti at 1:57 am (utc) on Dec. 17, 2007]
Thanks, I figured it was impossible, as noted here:
[forums.devshed.com...]
It consists of floating a vertical "pusher" element (such as img, but it's probably smarter to just use an empty div), then floating the desired object under it, using the clear property. The major problem with this method is you still have to know how many lines there are of text. It makes things MUCH easier though, and could definitely be coded with javascript, just need to change the height of the "pusher" to the height of the container minus the height of the float (assuming your container isn't fixed/min height).
In doing this, it's likely you'll encounter an interesting anomaly where the text will overlap (goes under in IE, goes over in firefox) with the float on the first line, hence I had to add a tweak to prevent that. Here's an example:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<title>your example</title>
<style type="text/css">
*{margin:0;padding:0}
body{background-color:#aaa}
img{float:right;background-color:#a40;width:1px;height:3.6em}
.div1{float:right;width:100px;height:2.4em;clear:right}
.div1 div{background-color:#a40;margin-top:1.2em}
</style>
</head>
<body>
<img><div class="div1"><div>test</div></div>test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test
</body>
</html>