Forum Moderators: not2easy

Message Too Old, No Replies

Controlling widths

Combining fixed and fluid widths

         

hessodreamy

4:58 pm on Feb 9, 2006 (gmt 0)

10+ Year Member



I'm sure this is very easy but I can't think how to do it.
How do I position something with a fixed width (eg a picture) on the page, and put something next to it (eg text) and tell it to fill the rest of the page, whatever size that might be?
This issue pops up from time to time. Presently I'm positioning an iframe next to a div. I want the div fixed width and the i frame to fill up the rest of the page.

Any help much appreciated.

coopersita

5:36 pm on Feb 9, 2006 (gmt 0)

10+ Year Member



You just have to set the div, image or whatever you want to be sorrounded by text to be floated. here's an example:

<img class="figure" src="x.gif" alt="test" widht="100" height="100" /> <p>Here would go the text you want to fill the screen with...</p>

The CSS:
.figure {float: left;}

Or you can also float to the right.

hessodreamy

9:10 am on Feb 10, 2006 (gmt 0)

10+ Year Member



Sorry I wasn't clear. I don't want the text to wrap around the image. I want to put it in a div which will fill the remaining width of the page. Alternatively, place an I frame which fills the remaining width.

hessodreamy

10:54 am on Feb 10, 2006 (gmt 0)

10+ Year Member



I guess what I'm really asking is how to replicate something like this:

<table width="100%">
<tr>
<td width="150"><img src="blah.jpg" width="150"></td>
<td>lots of text</td>
</tr>
</table>

Where the left cell is fixed and the right will be as wide as the rest of the screen.
But to do it without using tables.

xfinx

11:04 am on Feb 10, 2006 (gmt 0)

10+ Year Member



<img src="" style="float: left;"/><p style="margin-left:100px">bladiebla</p>

(testen in IE6 & FF 1.5 & Opera8)

edit. forgot the float