what is the best way to let a div fill the screen?

Discussion in 'HTML' started by windandwaves, Jun 25, 2005.

  1. windandwaves

    windandwaves Guest

    Hi Folk

    I am trying to do the following:

    <div id="d1" style='width: 215px; height: 117px; float: left;'>
    ....
    </div>
    <div id="logo" style='width: ????; height: 117px; float: right;'>
    <img src="i/logo.gif" alt="[...]" title="[..]">
    </div>

    whereby I want ???? to be something so that, at any screen-width, the cell
    fills the entire screen.

    In a table I would do

    ....
    <TABLE WIDTH="100%">
    <TD width="10"></TD>
    <TD>..</TD>
    </TABLE>

    but how do I resolve this with DIVs?

    TIA


    - Nicolaas
    windandwaves, Jun 25, 2005
    #1
    1. Advertising

  2. windandwaves

    Els Guest

    windandwaves wrote:

    > Hi Folk
    >
    > I am trying to do the following:
    >
    > <div id="d1" style='width: 215px; height: 117px; float: left;'>
    > ....
    > </div>
    > <div id="logo" style='width: ????; height: 117px; float: right;'>
    > <img src="i/logo.gif" alt="[...]" title="[..]">
    > </div>
    >
    > whereby I want ???? to be something so that, at any screen-width, the cell
    > fills the entire screen.
    >
    > In a table I would do
    >
    > ...
    > <TABLE WIDTH="100%">
    > <TD width="10"></TD>
    > <TD>..</TD>
    > </TABLE>
    >
    > but how do I resolve this with DIVs?


    Instead of setting a width to the second div, you give it a left
    margin of 215px to accommodate the first div. No need to float it
    right.

    --
    Els http://locusmeus.com/
    Sonhos vem. Sonhos vão. O resto é imperfeito.
    - Renato Russo -
    Els, Jun 25, 2005
    #2
    1. Advertising

  3. windandwaves

    windandwaves Guest

    Els wrote:
    > windandwaves wrote:
    >
    >> Hi Folk
    >>
    >> I am trying to do the following:
    >>
    >> <div id="d1" style='width: 215px; height: 117px; float: left;'>
    >> ....
    >> </div>
    >> <div id="logo" style='width: ????; height: 117px; float: right;'>
    >> <img src="i/logo.gif" alt="[...]" title="[..]">
    >> </div>
    >>
    >> whereby I want ???? to be something so that, at any screen-width,
    >> the cell fills the entire screen.
    >>
    >> In a table I would do
    >>
    >> ...
    >> <TABLE WIDTH="100%">
    >> <TD width="10"></TD>
    >> <TD>..</TD>
    >> </TABLE>
    >>
    >> but how do I resolve this with DIVs?

    >
    > Instead of setting a width to the second div, you give it a left
    > margin of 215px to accommodate the first div. No need to float it
    > right.


    Hoi Els

    At first, I did not believe you, but then I tried it and it worked like
    MAGIC. thank you so much, it showed me that I still do not fully understand
    float, but I understand it a lot better now!

    Cheers

    Nicolaas
    windandwaves, Jun 27, 2005
    #3
    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. Luigi Donatello Asero

    Let or not let the text float

    Luigi Donatello Asero, Jan 15, 2004, in forum: HTML
    Replies:
    6
    Views:
    457
    Steve R.
    Jan 15, 2004
  2. K Viltersten

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

    K Viltersten, Mar 30, 2009, in forum: ASP .Net
    Replies:
    4
    Views:
    726
  3. Biranchi Narayan Panda
    Replies:
    1
    Views:
    2,718
    Alexey Smirnov
    Feb 17, 2010
  4. lilostitch
    Replies:
    0
    Views:
    104
    lilostitch
    May 20, 2007
  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:
    177
    David Dorward
    Jun 1, 2005
Loading...

Share This Page