Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 20th, 2005, 11:37 PM
Ian Watts
Guest
 
Posts: n/a
Default Float/Div Confusion

I am trying without success to understand what is going on. I am
developing a site at

http://www.ianwatts.info/edensor/

http://www.ianwatts.info/edensor/edensor.css

and I have two problems.

1. I want the text (The Best Lesson of the Week) to sit at the right
hand side of the image - I have tried not floating, and it sits
underneath the image, the same goes with setting margin-left to 50 or
60% - it still sits underneath. So I tried floating left, and it then
sits outside the content div altogether. Surely float shouldn't take it
out of its normal flow?

2. The menu bar (which I pinched the idea from
http://www.alistapart.com/articles/dropdowns) will not center in the
content div - it pushes to the left all of the time. I have tried
various solutions, but to no avail.

I realise that navigation that relies on JS isn't a good idea, and when
finished the site will have alternative navigation in for non JS users -
for now it is simply a prototype.

Many thanks in advance


Ian Watts
  #2  
Old July 20th, 2005, 11:37 PM
Ian Watts
Guest
 
Posts: n/a
Default Re: Float/Div Confusion

Ian Watts wrote:[color=blue]
> I am trying without success to understand what is going on. I am
> developing a site at
>
> http://www.ianwatts.info/edensor/
>
> http://www.ianwatts.info/edensor/edensor.css
>
> and I have two problems.
>
> 1. I want the text (The Best Lesson of the Week) to sit at the right
> hand side of the image - I have tried not floating, and it sits
> underneath the image, the same goes with setting margin-left to 50 or
> 60% - it still sits underneath. So I tried floating left, and it then
> sits outside the content div altogether. Surely float shouldn't take it
> out of its normal flow?
>[/color]
I forgot to say that I have tested in IE6 and Firefox .8 - in IE6 it
stays within the content div but below the image -what am I doing wrong?
[color=blue]
> 2. The menu bar (which I pinched the idea from
> http://www.alistapart.com/articles/dropdowns) will not center in the
> content div - it pushes to the left all of the time. I have tried
> various solutions, but to no avail.
>
> I realise that navigation that relies on JS isn't a good idea, and when
> finished the site will have alternative navigation in for non JS users -
> for now it is simply a prototype.
>
> Many thanks in advance
>
>
> Ian Watts[/color]
  #3  
Old July 20th, 2005, 11:37 PM
Neal
Guest
 
Posts: n/a
Default Re: Float/Div Confusion

On Mon, 17 May 2004 22:27:53 +0100, Ian Watts
<iwatts.remove.this@ntlworld.com.and.this> wrote:
[color=blue]
> I am trying without success to understand what is going on. I am
> developing a site at
>
> http://www.ianwatts.info/edensor/
>
> http://www.ianwatts.info/edensor/edensor.css
>
> and I have two problems.
>
> 1. I want the text (The Best Lesson of the Week) to sit at the right
> hand side of the image - I have tried not floating, and it sits
> underneath the image, the same goes with setting margin-left to 50 or
> 60% - it still sits underneath. So I tried floating left, and it then
> sits outside the content div altogether. Surely float shouldn't take it
> out of its normal flow?[/color]

Float sends it to the farthest possible position in its containing block,
and the next element is rendered at the floated element's position.

If you want the image and the text at the same vertical height, float what
comes first. Otherwise, it goes to its normal flow, which is whjat's
happening quite correctly.
  #4  
Old July 20th, 2005, 11:37 PM
Ian Watts
Guest
 
Posts: n/a
Default Re: Float/Div Confusion

Neal wrote:[color=blue]
> On Mon, 17 May 2004 22:27:53 +0100, Ian Watts
> <iwatts.remove.this@ntlworld.com.and.this> wrote:
>[color=green]
>> I am trying without success to understand what is going on. I am
>> developing a site at
>>
>> http://www.ianwatts.info/edensor/
>>
>> http://www.ianwatts.info/edensor/edensor.css
>>
>> and I have two problems.
>>
>> 1. I want the text (The Best Lesson of the Week) to sit at the
>> right hand side of the image - I have tried not floating, and it sits
>> underneath the image, the same goes with setting margin-left to 50 or
>> 60% - it still sits underneath. So I tried floating left, and it then
>> sits outside the content div altogether. Surely float shouldn't take
>> it out of its normal flow?[/color]
>
>
> Float sends it to the farthest possible position in its containing
> block, and the next element is rendered at the floated element's position.
>
> If you want the image and the text at the same vertical height, float
> what comes first. Otherwise, it goes to its normal flow, which is
> whjat's happening quite correctly.[/color]
Thanks Neal

I tried that, and first off - nothing - the text still seemed to
disappear down the bottom, underneat the content div.

However, it seems that the menu bar was confusing matters - when I put
that in a containing div, eveything worked fine.

However, I still can't get the menu bar to center - I have tried setting
margin-left and margin-right to auto, and have tried text-align to
center (all of this on menu div, the container for the menu), but it
seems to stay pushed to the left.

I have tried this in IE6 and Firefox .8.

Thanks

Ian
 

Bookmarks

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles