Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > css question

Reply
Thread Tools

css question

 
 
windandwaves
Guest
Posts: n/a
 
      05-30-2005
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>
</DIV>

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

what am i doing wrong?

TIA

- Nicolaas


 
Reply With Quote
 
 
 
 
Mark Parnell
Guest
Posts: n/a
 
      05-30-2005
Previously in alt.html, windandwaves <> said:

> I am still having trouble with the float business.


http://www.w3.org/TR/CSS2/visuren.html#floats

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


> what am i doing wrong?


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
http://www.clarkecomputers.com.au
alt.html FAQ :: http://html-faq.com/
 
Reply With Quote
 
 
 
 
William Hughes
Guest
Posts: n/a
 
      05-30-2005
On Mon, 30 May 2005 12:07:56 +1200, in alt.html "windandwaves"
<> wrote:

> 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>
> </DIV>
>
> but it does not seem to work (COPY ends up under MENU - btw I am using HTML
> strict)
>
> what am i doing wrong?
>
> TIA
>
> - Nicolaas


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>

<div class=main>

PAGE BODY HERE

</div>


 
Reply With Quote
 
windandwaves
Guest
Posts: n/a
 
      05-30-2005
William Hughes wrote:
> On Mon, 30 May 2005 12:07:56 +1200, in alt.html "windandwaves"
> <> wrote:
>
>> 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>
>> </DIV>
>>
>> but it does not seem to work (COPY ends up under MENU - btw I am
>> using HTML strict)
>>
>> what am i doing wrong?
>>
>> TIA
>>
>> - Nicolaas

>
> 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>
>
> <div class=main>
>
> PAGE BODY HERE
>
> </div>


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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: correction: A question about css (was: A question about css) richard HTML 12 03-09-2010 08:52 PM
Is this the newsgroup for CSS help? CSS Question Included AF HTML 17 08-09-2006 06:57 PM
CSS question - can I make CSS Cascade sideways? Bill_W_Stephens@yahoo.com HTML 6 03-18-2006 06:02 PM
CSS Layout question - how to duplicate a table layout with CSS Eric ASP .Net 4 12-24-2004 04:54 PM
print.css and screen.css tom watson HTML 1 09-09-2003 02:48 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57