Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Fixed and variable width boxes on one line

0 views
Skip to first unread message

Alex

unread,
Jan 4, 2007, 10:32:37 PM1/4/07
to
Hello All.

I am trying to display 2 boxes contained in third: [[A][B]], A and B should
be one line. The A box with fixed width, while width for the box B should be
computed, basing on container box width.

So I whould like to have some like this:

.container { height:10px; width:100px; }
.A { height:10px; width:100px; }
.B { height:10px; width:???; }

<div class="container">
<div class="B"></div>
<div class="C"></div>
</div>

And computed B width 90px.

All my attempts failed. I wonder if it is possible at all... Any help will
be appreciated.

Thanks,
- Alex.


Alex

unread,
Jan 6, 2007, 10:56:18 PM1/6/07
to
Found... Combination of float and relative positioning :-)

<html>
<head>
<style type="text/css">
<!--
#container {
width:300px;
border:1px gray dashed;
padding: 4px;
}

#left {
background:silver;
width: 50px;
float: left;
border:1px maroon solid;
}

#right {
background:orange;
margin-left:50;
position: relative;
width: auto;
border:1px maroon solid;
}

-->
</style>
</head>

<body>
<div id="container">
<div id="left">&nbsp;</div>
<div id="right">&nbsp;</div>
</div>
</body>

</html>


0 new messages