Forum Moderators: not2easy
Here's the css:
body {margin-top: 0px; margin-left: 0px;}
#colA {float: left; background-color: #333300; width: 60%; padding-top: 20px;}
#colB {float: left; background-color: #999966; border: solid 1px #999966; width: 170px; margin-top: 100px; margin-left: 50px; text-align: center;}
and the markup...
<div id="colA">
Some text here.
</div>
<div id="colB">
<img src="image.jpg" align="right" border="0" alt="logo" width="170" height="118">
</div>
and the problem...
Unless the browser window is maximized (or at least nearly so), colB drops down underneath colA. I'd rather have colA and colB remain side by side no matter what, and if a horizontal scrollbar becomes necessary, so be it.
FWIW, I've also tried floating colB right as well.
I'm sure I'm missing something basic here. All clues are welcome.
Thanks,
Mid
Instead of float:left, for colA you give position:absolute;top:0;left:0
and for colB position:absolute;left:60%;top:0
The only other option I can think of by keeping the floats, is to use javascript (can't be done with current CSS technology because it's a mix of percentage and pixels) to size a container div to be equal to the width of the two other divs (including border margin and padding).
[edited by: Xapti at 6:31 am (utc) on June 27, 2007]