Re: div-float

Discussion in 'HTML' started by dorayme, Apr 22, 2008.

  1. dorayme

    dorayme Guest

    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
     
    dorayme, Apr 22, 2008
    #1
    1. Advertising

  2. dorayme

    dorayme Guest

    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
     
    dorayme, Apr 22, 2008
    #2
    1. Advertising

  3. dorayme

    dorayme Guest

    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
     
    dorayme, Apr 22, 2008
    #3
  4. dorayme

    rf Guest

    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
     
    rf, Apr 23, 2008
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bd
    Replies:
    0
    Views:
    634
  2. Jimmy
    Replies:
    7
    Views:
    4,936
    Chaddy2222
    Nov 21, 2008
  3. K Viltersten

    <div ... /> and <div ...></div>

    K Viltersten, Mar 30, 2009, in forum: ASP .Net
    Replies:
    4
    Views:
    756
  4. Carsten Fuchs
    Replies:
    45
    Views:
    1,558
    James Kanze
    Oct 8, 2009
  5. Dwayne Madsen

    Q: Div A inside Div B is larger than Div B

    Dwayne Madsen, Jun 1, 2005, in forum: Javascript
    Replies:
    1
    Views:
    195
    David Dorward
    Jun 1, 2005
Loading...

Share This Page