Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Re: div-float

Reply
Thread Tools

Re: div-float

 
 
dorayme
Guest
Posts: n/a
 
      04-22-2008
In article <>,
Gus Richter <> wrote:

> Neredbojias wrote:
> > On 22 Apr 2008, artev <> wrote:
> >
> >> if I have 6 divs,
> >> div1 div2 div3 div4 div5 div6
> >>
> >> if I use float:left for all, the divs are all near in one row.
> >>
> >> how can to have put side by side in two rows;
> >> i.e. first 3 near and other 3 near but below;
> >> notice: I not want use other div for group first 3; but want use the
> >> style;
> >>
> >>
> >> I tested with insertion on div4 the clear:left;
> >> div4 ok I have in 2nd row but is all expanse and not have near the
> >> div5 and div6.
> >> howcan resolve?
> >>
> >> ------------------------------------------------
> >>
> >> other: for to have
> >> <div>
> >> div1 div2 div3
> >> </div>
> >>
> >> three div near using the float and one external div that contain
> >> all, is possible?
> >> ask because with float of div1 div2 div3 the external div not work
> >> good

> >
> > Try this:
> >
> > <div>
> > div1 div2 div3
> > </div>
> > <div style="clear:both;">
> > div4 div5 div6
> > </div>

>
> Try also:
>
> div1 div2 div3
> <div style="clear:left;"></div>
> div4 div5 div6


Or perhaps more economical still:

div1 div2 div3
div4 div5 div6

and style div4 with clear: left;

--
dorayme
 
Reply With Quote
 
 
 
 
dorayme
Guest
Posts: n/a
 
      04-22-2008
In article <>,
Ed Jay <> wrote:

> dorayme scribed:
>
> >In article <>,
> > Gus Richter <> wrote:
> >
> >> Neredbojias wrote:
> >> > On 22 Apr 2008, artev <> wrote:
> >> >
> >> >> if I have 6 divs,
> >> >> div1 div2 div3 div4 div5 div6
> >> >>
> >> >> if I use float:left for all, the divs are all near in one row.
> >> >>
> >> >> how can to have put side by side in two rows;
> >> >> i.e. first 3 near and other 3 near but below;
> >> >> notice: I not want use other div for group first 3; but want use the
> >> >> style;
> >> >>
> >> >>
> >> >> I tested with insertion on div4 the clear:left;
> >> >> div4 ok I have in 2nd row but is all expanse and not have near the
> >> >> div5 and div6.
> >> >> howcan resolve?
> >> >>
> >> >> ------------------------------------------------
> >> >>
> >> >> other: for to have
> >> >> <div>
> >> >> div1 div2 div3
> >> >> </div>
> >> >>
> >> >> three div near using the float and one external div that contain
> >> >> all, is possible?
> >> >> ask because with float of div1 div2 div3 the external div not work
> >> >> good
> >> >
> >> > Try this:
> >> >
> >> > <div>
> >> > div1 div2 div3
> >> > </div>
> >> > <div style="clear:both;">
> >> > div4 div5 div6
> >> > </div>
> >>
> >> Try also:
> >>
> >> div1 div2 div3
> >> <div style="clear:left;"></div>
> >> div4 div5 div6

> >
> >Or perhaps more economical still:
> >
> >div1 div2 div3
> >div4 div5 div6
> >
> >and style div4 with clear: left;

>
> Would it be styled clear:left;float:left; ?


I assume you would have something like div {float: left;} in your css in
the head or linked file. You just style the particular div4 one with the
extra instruction because that is the one tha you want to clear the
previous floats. Or, put it another way, yes, it should be styled float:
left just as all the other divs are so styled.

--
dorayme
 
Reply With Quote
 
 
 
 
dorayme
Guest
Posts: n/a
 
      04-22-2008
In article <>,
Ben C <> wrote:

> > Or perhaps more economical still:
> >
> > div1 div2 div3
> > div4 div5 div6
> >
> > and style div4 with clear: left;

>
> But OP said he tried this but had "all expanse and not have near the
> div5 and div6".
>
> I am puzzled by this. I wondered if the floats are not all the same
> sizes and shapes and the problem is one of "float snagging". But I can't
> think how, because clear on div4 should get it clear of all of divs 1, 2
> and 3, so even if they are different heights, div5 should make it to the
> right edge of div4.
>
> As far as I can see what you're suggesting and what the OP originally
> tried should work, unless this is just an IE bug or something.
>
> artev: I think you need to post a URL to your test page.


Good idea!

Given OP's further question to me, he *may* be inline css'ing all the
divs except div4 and using clear only on that one and forgetting or not
knowing to also float it?

--
dorayme
 
Reply With Quote
 
rf
Guest
Posts: n/a
 
      04-23-2008
Ed Jay <> wrote in
news::

> Why doesn't the clear clear the float?


As somebody pointed out over at aww (where BTW this question has been
multiposted) this appears to be a bug in IE, all versions.

The cleared element does clear the floated elements above it (in the
source) but the following floats incorrectly float above the clearing
element. IE is breaking rule 5 of float behaviour.

--
Richard
Killing all threads involving google groups
The Usenet Improvement Project: http://improve-usenet.org
 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57