469,649 Members | 1,248 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,649 developers. It's quick & easy.

div out of line

Hi all,

I've got a problem which has doing my head in for couple of days now; i have
2 div's as follow:

#diva {float:left; width: 600px}

#divb {float: left; width: 220px}

then in the html:
<div>
<diva></div>
<divb></div>
</div>

So that diva and divb are next to each other in 1 line. This works on
resolutions 1024*768 or higher; but on 800*600 and lower; divb appears
underneath diva.

Is it possible that diva and divb are always next to each other; and if the
resolution is too low then create a horizontal scrollbar?

I hope i explained it clearly enough but let me know if in doubt.

Kind regards

T
Dec 29 '06 #1
1 1747
toffee wrote:
i have 2 div's as follow:

#diva {float:left; width: 600px}

#divb {float: left; width: 220px}

then in the html:
<div>
<diva></div>
<divb></div>
</div>

So that diva and divb are next to each other in 1 line. This works on
resolutions 1024*768 or higher; but on 800*600 and lower; divb appears
underneath diva.
600px + 220px 800px.

See http://www.w3.org/TR/REC-CSS2/visuren.html#floats

"A left-floating box that has another left-floating box to its left may
not have its right outer edge to the right of its containing block's
right edge. (Loosely: a left float may not stick out at the right edge,
unless it is already as far to the left as possible.) An analogous rule
holds for right-floating elements."

Is it possible that diva and divb are always next to each other; and if the
resolution is too low then create a horizontal scrollbar?

If diva and divb must be of fixed width (as against in the equivalent
width ratio) place diva and divb in a containing div of width >= 820px

Louise
Dec 29 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Adi | last post: by
6 posts views Thread by magix | last post: by
14 posts views Thread by WStoreyII | last post: by
11 posts views Thread by xdevel | last post: by
19 posts views Thread by =?Utf-8?B?QnJpYW4gQ29vaw==?= | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.