HighDots Forums  

div out of line

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss div out of line in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
toffee
 
Posts: n/a

Default div out of line - 12-28-2006 , 08:29 PM






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



Reply With Quote
  #2  
Old   
boclair
 
Posts: n/a

Default Re: div out of line - 12-28-2006 , 11:08 PM






toffee wrote:
Quote:
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."


Quote:
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


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.