css question

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi Dudettes and Dudes,

Sad as it may be, I am still having trouble with the float business.

If I want to put two divs next to each other and let them slip one under the
other in no way then how do I do that.

My plan was:

<DIV ID="main">
 <DIV ID="menu" STYLE="float: left;">menu items</DIV>
 <DIV ID="copy" STYLE="float: right;">copy stuff</DIV>

but it does not seem to work (COPY ends up under MENU - btw I am using HTML

what am i doing wrong?


- Nicolaas

Re: css question

Quoted text here. Click to load it


Quoted text here. Click to load it

For one, you aren't including a width - width is required when using
float[1]. My guess would be that the browser is assuming a width of 100%
or something, but who knows?

Depending on what you are doing, you probably don't need to specify
float: right on the second one. In fact, you may be better off using
float: left, but that depends on the desired result.

[1] In most situations, including this one.

Mark Parnell
alt.html FAQ :: http://html-faq.com /

Re: css question

On Mon, 30 May 2005 12:07:56 +1200, in alt.html "windandwaves"

Quoted text here. Click to load it

In *.css:

div.menu { float: left; width: 25%; color: #000000; background: #c0c0c0
url(./img/bg-menu.gif) }
div.main { float: right; width: 73% }

Note: I deliberately left a 2% "gutter" for spacing, otherwise the text in
"main" winds up hard against "menu".

In *.htm:

<div class=menu>
<!--#include virtual="./includes/menu.htm"-->

<div class=main>



Re: css question

William Hughes wrote:
Quoted text here. Click to load it

that works magically (www.wapitipark.co.nz/AV/)

Site Timeline