floating a div

Discussion in 'HTML' started by Rob Swindells, Mar 4, 2004.

  1. if I put two div's next to each other using "float : right" like so on
    div 2:

    [ div 1 ][ div 2 ]
    [ div 3 ]

    as that div 2 fills up with content it should push div 3 down the page.
    It does this in IE6 & Opera 7 but not Mozilla 1.6. Is there an attribute
    I can add to the div 2 to make it act properly?

    Rob
     
    Rob Swindells, Mar 4, 2004
    #1
    1. Advertising

  2. Rob Swindells

    Els Guest

    Rob Swindells wrote:

    > if I put two div's next to each other using "float : right" like so on
    > div 2:
    >
    > [ div 1 ][ div 2 ]
    > [ div 3 ]
    >
    > as that div 2 fills up with content it should push div 3 down the page.
    > It does this in IE6 & Opera 7 but not Mozilla 1.6. Is there an attribute
    > I can add to the div 2 to make it act properly?


    I think you are looking for <div style="clear:both"></div>
    after the second div.

    --
    Els

    Sonhos vem. Sonhos vão. O resto é imperfeito.
    - Renato Russo -
     
    Els, Mar 4, 2004
    #2
    1. Advertising

  3. Rob Swindells

    rf Guest

    "Els" <> wrote in message
    news:40471e06$0$41756$...
    >
    >
    > Rob Swindells wrote:
    >
    > > if I put two div's next to each other using "float : right" like so on
    > > div 2:
    > >
    > > [ div 1 ][ div 2 ]
    > > [ div 3 ]
    > >
    > > as that div 2 fills up with content it should push div 3 down the page.
    > > It does this in IE6 & Opera 7 but not Mozilla 1.6. Is there an attribute
    > > I can add to the div 2 to make it act properly?

    >
    > I think you are looking for <div style="clear:both"></div>
    > after the second div.


    Apply the style to div 3. No need here for an empty div.

    Cheers
    Richard.
     
    rf, Mar 4, 2004
    #3
  4. Rob Swindells

    Els Guest

    rf wrote:

    > "Els" <> wrote in message
    > news:40471e06$0$41756$...
    >
    >>Rob Swindells wrote:
    >>
    >>>if I put two div's next to each other using "float : right" like so on
    >>>div 2:
    >>>
    >>>[ div 1 ][ div 2 ]
    >>>[ div 3 ]
    >>>
    >>>as that div 2 fills up with content it should push div 3 down the page.
    >>>It does this in IE6 & Opera 7 but not Mozilla 1.6. Is there an attribute
    >>>I can add to the div 2 to make it act properly?

    >>
    >>I think you are looking for <div style="clear:both"></div>
    >>after the second div.

    >
    > Apply the style to div 3. No need here for an empty div.


    True. (as long as div 3 won't have another floating element
    next to it)
    Thought about that after I pressend 'send'.

    --
    Els

    Sonhos vem. Sonhos vão. O resto é imperfeito.
    - Renato Russo -
     
    Els, Mar 4, 2004
    #4
  5. Els wrote:
    > rf wrote:
    >
    >> "Els" <> wrote in message
    >> news:40471e06$0$41756$...
    >>
    >>> Rob Swindells wrote:
    >>>
    >>>> if I put two div's next to each other using "float : right" like so on
    >>>> div 2:
    >>>>
    >>>> [ div 1 ][ div 2 ]
    >>>> [ div 3 ]
    >>>>
    >>>> as that div 2 fills up with content it should push div 3 down the page.
    >>>> It does this in IE6 & Opera 7 but not Mozilla 1.6. Is there an
    >>>> attribute
    >>>> I can add to the div 2 to make it act properly?
    >>>
    >>>
    >>> I think you are looking for <div style="clear:both"></div>
    >>> after the second div.

    >>
    >>
    >> Apply the style to div 3. No need here for an empty div.

    >
    >
    > True. (as long as div 3 won't have another floating element next to it)
    > Thought about that after I pressend 'send'.
    >


    Putting clear : both in div 3 worked how I wanted. Thankyou very much.

    Rob ( Avagio IT Services )
    {
    http://www.avagio.co.uk;
    }
     
    Rob Swindells, Mar 4, 2004
    #5
    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. Tamlyn Rhodes
    Replies:
    3
    Views:
    1,027
    Andy Dingley
    Feb 26, 2004
  2. K Viltersten

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

    K Viltersten, Mar 30, 2009, in forum: ASP .Net
    Replies:
    4
    Views:
    788
  3. teeshift
    Replies:
    2
    Views:
    284
    Chris Pearl
    Dec 1, 2006
  4. Dwayne Madsen

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

    Dwayne Madsen, Jun 1, 2005, in forum: Javascript
    Replies:
    1
    Views:
    219
    David Dorward
    Jun 1, 2005
  5. mscir
    Replies:
    3
    Views:
    343
    Martin Honnen
    Jun 26, 2005
Loading...

Share This Page