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

W

windandwaves

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
 
E

Els

windandwaves said:
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.
 
W

windandwaves

Els said:
windandwaves said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top