Way to stop DIVs from wrapping?

J

Jeff Bowman

<div id="Outer">
<div style="float:left;" id="InnerLeft">Left Content</div>
<div style="float:right;" id="InnerRight">Right Content</div>
</div>

Is there a way to stop InnerRight from shifting underneath InnerLeft when the
browser is resized smaller?

Thanks,
Jeff
 
J

Jan Faerber

Jeff Bowman ... output:
<div id="Outer">
<div style="float:left;" id="InnerLeft">Left Content</div>
<div style="float:right;" id="InnerRight">Right Content</div>
</div>

Is there a way to stop InnerRight from shifting underneath InnerLeft when
the browser is resized smaller?

Thanks,
Jeff

To achieve wrapping with smaller browser width you can use 'float'.
If you don't like it don't use it.
 
J

Jeff Bowman

Hi Jan, thanks for your reply.

Actually, I'm looking for a way to /stop/ wrapping, even when the browser is
resized smaller. I'd like to have the DIVs' contents stay on the same horizontal
plane and a horizontal scrollbar to appear, just like how a table behaves.

Do you know if this is possible?

Thanks,
Jeff
 
J

Jeff Bowman

Jan said:
To achieve wrapping with smaller browser width you can use 'float'.
If you don't like it don't use it.

Hi Jan, thanks for your reply.

Actually, I'm looking for a way to stop wrapping, even when the browser is
resized smaller. I'd like to have the DIVs' contents stay on the same horizontal
plane and a horizontal scrollbar to appear, just like how a table behaves.

Do you know if this is possible?

Thanks,
Jeff
 
T

Toby Inkster

Jeff said:
Actually, I'm looking for a way to stop wrapping, even when the browser is
resized smaller.

Absolute positioning within a positioned wrapper?

<div style="position:relative">
<div style="width:50%;position:absolute;top:0;left:0">...</div>
<div style="width:50%;position:absolute;top:0;left:50%">...</div>
</div>

Add salt and pepper to taste.
 
J

Jeff Bowman

Toby said:
<div style="position:relative">
<div style="width:50%;position:absolute;top:0;left:0">...</div>
<div style="width:50%;position:absolute;top:0;left:50%">...</div>
</div>

Add salt and pepper to taste.

By George, I think he's got it! :)

Thanks, Toby.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top