Groups > Browsers > Opera Browser Page display > Re: Is 'float: right' right?




Re: Is 'float: right' right?

Re: Is 'float: right' right?
15 Dec 2006 06:01:00 -0800
Brian L Johnson wrote:

> <URL= http://www.simpol.com/ >
>
> and notice how the menu "Home News Contact " etc is positioned
over at
> the left hand side -- over the logo.
>
> IE & FF display this menu correctly -- over at the right.
>
> The HTML validates correctly as XHTML 1.0 Strict and the CSS at
> <URL= http://www.simpol.com/css/main.css > also validates (with a
few
> warnings about color.)
>
> So why does Opera display the menu in the wrong place?

The menu is contained within an absolutely positioned div. This div has
no width specified so Opera shrinks it to fit its content. Hence the
right floated list is floated within a box that is only big enough to
contain it.

What is more puzzling is why IE and FF don't do this. I would have said
that Opera's behaviour was what should be expected. There must be some
detail that I'm missing.

   Steve
Post Reply
Re: Is 'float: right' right?
15 Dec 2006 08:13:39 -0800
Brian L Johnson wrote:
> Steve Pugh wrote
> > Brian L Johnson wrote:
> >
> > > <URL= http://www.simpol.com/ >
> > >
> > > and notice how the menu "Home News Contact " etc is
positioned over at
> > > the left hand side -- over the logo.
> > >
> > > IE & FF display this menu correctly -- over at the right.
> > >
> > > The HTML validates correctly as XHTML 1.0 Strict and the CSS at
> > > <URL= http://www.simpol.com/css/main.css > also validates
(with a few
> > > warnings about color.)
> > >
> > > So why does Opera display the menu in the wrong place?
> >
> > The menu is contained within an absolutely positioned div. This div
has
> > no width specified so Opera shrinks it to fit its content. Hence the
> > right floated list is floated within a box that is only big enough to
> > contain it.
> >
> So what you're saying is that because the div has no width, Opera starts
> creating it at the left-hand edge of the screen, yes?

The div isn't floated. The div is absolutely positioned. The ul inside
the div is floated.

> If it's float: right, why doesn't it start creating it at the right-hand
> edge?

The ul does start at the right hand edge of the shrunk to fit div
#navtop.

> > What is more puzzling is why IE and FF don't do this. I would have
said
> > that Opera's behaviour was what should be expected. There must be
some
> > detail that I'm missing.
> >
> Maybe. But... the SBLogo div does have a width specified and is floated
> right and it appears at the right.

The SBLogo is contained within an absolutely positioned div, just the
same as the topnav. But the div (#header in this case) has a width set
to 100% and hence does not shrink to fit.

There seems to be far too much absolute positioning being used on that
page. I would suggest that simpler CSS would work just as well and
would be easier to debug.

   Steve
Post Reply
Re: Is 'float: right' right?
15 Dec 2006 09:20:15 -0800
Brian L Johnson wrote:
> Steve Pugh wrote
> > Brian L Johnson wrote:
> >
> > > <URL= http://www.simpol.com/ >
> > >
> > > and notice how the menu "Home News Contact " etc is
positioned over at
> > > the left hand side -- over the logo.
> > >
> > > IE & FF display this menu correctly -- over at the right.
> > >
> > > The HTML validates correctly as XHTML 1.0 Strict and the CSS at
> > > <URL= http://www.simpol.com/css/main.css > also validates
(with a few
> > > warnings about color.)
> > >
> > > So why does Opera display the menu in the wrong place?
> >
> > The menu is contained within an absolutely positioned div. This div
has
> > no width specified so Opera shrinks it to fit its content. Hence the
> > right floated list is floated within a box that is only big enough to
> > contain it.
> >
> So what you're saying is that because the div has no width, Opera starts
> creating it at the left-hand edge of the screen, yes?

The div isn't floated. The div is absolutely positioned. The ul inside
the div is floated.

> If it's float: right, why doesn't it start creating it at the right-hand
> edge?

The ul does start at the right hand edge of the shrunk to fit div
#navtop.

> > What is more puzzling is why IE and FF don't do this. I would have
said
> > that Opera's behaviour was what should be expected. There must be
some
> > detail that I'm missing.
> >
> Maybe. But... the SBLogo div does have a width specified and is floated
> right and it appears at the right.

The SBLogo is contained within an absolutely positioned div, just the
same as the topnav. But the div (#header in this case) has a width set
to 100% and hence does not shrink to fit.

There seems to be far too much absolute positioning being used on that
page. I would suggest that simpler CSS would work just as well and
would be easier to debug.

   Steve
Post Reply
Is 'float: right' right?
Fri, 15 Dec 2006 09:47:14 -000
Check out 

<URL= http://www.simpol.com/ >

and notice how the menu "Home News Contact " etc is positioned over at

the left hand side -- over the logo.  

IE & FF display this menu correctly -- over at the right.

The HTML validates correctly as XHTML 1.0 Strict and the CSS at
<URL= http://www.simpol.com/css/main.css > also validates (with a few 
warnings about color.)

So why does Opera display the menu in the wrong place?

-- 
Post Reply
Re: Is 'float: right' right?
15 Dec 2006 09:49:34 -0800
Brian L Johnson wrote:
> Steve Pugh wrote
> > Brian L Johnson wrote:
> >
> > > <URL= http://www.simpol.com/ >
> > >
> > > and notice how the menu "Home News Contact " etc is
positioned over at
> > > the left hand side -- over the logo.
> > >
> > > IE & FF display this menu correctly -- over at the right.
> > >
> > > The HTML validates correctly as XHTML 1.0 Strict and the CSS at
> > > <URL= http://www.simpol.com/css/main.css > also validates
(with a few
> > > warnings about color.)
> > >
> > > So why does Opera display the menu in the wrong place?
> >
> > The menu is contained within an absolutely positioned div. This div
has
> > no width specified so Opera shrinks it to fit its content. Hence the
> > right floated list is floated within a box that is only big enough to
> > contain it.
> >
> So what you're saying is that because the div has no width, Opera starts
> creating it at the left-hand edge of the screen, yes?

The div isn't floated. The div is absolutely positioned. The ul inside
the div is floated.

> If it's float: right, why doesn't it start creating it at the right-hand
> edge?

The ul does start at the right hand edge of the shrunk to fit div
#navtop.

> > What is more puzzling is why IE and FF don't do this. I would have
said
> > that Opera's behaviour was what should be expected. There must be
some
> > detail that I'm missing.
> >
> Maybe. But... the SBLogo div does have a width specified and is floated
> right and it appears at the right.

The SBLogo is contained within an absolutely positioned div, just the
same as the topnav. But the div (#header in this case) has a width set
to 100% and hence does not shrink to fit.

There seems to be far too much absolute positioning being used on that
page. I would suggest that simpler CSS would work just as well and
would be easier to debug.

   Steve
Post Reply
<< Previous 1 2 Next >>
( Page 1 of 2 )
about | contact