By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,447 Members | 1,172 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,447 IT Pros & Developers. It's quick & easy.

Safari and float problem

P: n/a
Hi

Suppose I want a header containing an image floated left and a list of
horizontal links floated right.

So I float the image left. I then do the following with the list:

ul = float: right
li = display: inline
li a = display: block; float: left

I display: block on the a elements so I can apply vertical padding and
background images.

This works fine in IE6/IE7 and Firefox but not Safari for Windows, where
the list appears to lose its float: right property, and instead rests
against the right side of the image.

You can see a test case here:

http://www.lester1.eclipse.co.uk/test/

Is this a Safari float bug? How can I get the list to float right in Safari?
Feb 7 '08 #1
Share this Question
Share on Google+
5 Replies


P: n/a
In article <61*************@mid.individual.net>,
John <us**@example.netwrote:
Hi

Suppose I want a header containing an image floated left and a list of
horizontal links floated right.

So I float the image left. I then do the following with the list:

ul = float: right
li = display: inline
li a = display: block; float: left

I display: block on the a elements so I can apply vertical padding and
background images.

This works fine in IE6/IE7 and Firefox but not Safari for Windows, where
the list appears to lose its float: right property, and instead rests
against the right side of the image.

You can see a test case here:

http://www.lester1.eclipse.co.uk/test/

Is this a Safari float bug? How can I get the list to float right in Safari?
First thing to be said is that Safari, iCab and Opera line up
together on this and have the menu to the right more, whereas FF,
Camino, (and MacIE5 just btw) have it more to the left. So I am
inclined not to think a bug.

--
dorayme
Feb 7 '08 #2

P: n/a
In article
<do**********************************@news-vip.optusnet.com.au>,
dorayme <do************@optusnet.com.auwrote:
In article <61*************@mid.individual.net>,
John <us**@example.netwrote:
Hi

Suppose I want a header containing an image floated left and a list of
horizontal links floated right.

So I float the image left. I then do the following with the list:

ul = float: right
li = display: inline
li a = display: block; float: left

I display: block on the a elements so I can apply vertical padding and
background images.

This works fine in IE6/IE7 and Firefox but not Safari for Windows, where
the list appears to lose its float: right property, and instead rests
against the right side of the image.

You can see a test case here:

http://www.lester1.eclipse.co.uk/test/

Is this a Safari float bug? How can I get the list to float right in Safari?

First thing to be said is that Safari, iCab and Opera line up
together on this and have the menu to the right more, whereas FF,
Camino, (and MacIE5 just btw) have it more to the left. So I am
inclined not to think a bug.
Second thing is to remove your:

#header {
float: left;
}

--
dorayme
Feb 7 '08 #3

P: n/a
On 2008-02-07, dorayme <do************@optusnet.com.auwrote:
In article <61*************@mid.individual.net>,
John <us**@example.netwrote:
>Hi

Suppose I want a header containing an image floated left and a list of
horizontal links floated right.

So I float the image left. I then do the following with the list:

ul = float: right
li = display: inline
li a = display: block; float: left

I display: block on the a elements so I can apply vertical padding and
background images.

This works fine in IE6/IE7 and Firefox but not Safari for Windows, where
the list appears to lose its float: right property, and instead rests
against the right side of the image.

You can see a test case here:

http://www.lester1.eclipse.co.uk/test/

Is this a Safari float bug? How can I get the list to float right in Safari?

First thing to be said is that Safari, iCab and Opera line up
together on this and have the menu to the right more, whereas FF,
Camino, (and MacIE5 just btw) have it more to the left. So I am
inclined not to think a bug.
It's this issue, which I explained before here:

http://groups.google.co.uk/group/alt...15dbc687d633a4

Definitely not a bug in Safari or Opera. Firefox's interpretation of the
spec is a bit weird I think but not technically wrong.

OP should just get rid of float: left on #header. Then it will be the
full width of its container, and so right floats will go all the way to
the right and left floats all the way to the left.
Feb 7 '08 #4

P: n/a
In article <sl*********************@bowser.marioworld>,
Ben C <sp******@spam.eggswrote:
On 2008-02-07, dorayme <do************@optusnet.com.auwrote:
In article <61*************@mid.individual.net>,
John <us**@example.netwrote:
Hi

Suppose I want a header containing an image floated left and a list of
horizontal links floated right.

So I float the image left. I then do the following with the list:

ul = float: right
li = display: inline
li a = display: block; float: left

I display: block on the a elements so I can apply vertical padding and
background images.

This works fine in IE6/IE7 and Firefox but not Safari for Windows, where
the list appears to lose its float: right property, and instead rests
against the right side of the image.

You can see a test case here:

http://www.lester1.eclipse.co.uk/test/

Is this a Safari float bug? How can I get the list to float right in
Safari?
First thing to be said is that Safari, iCab and Opera line up
together on this and have the menu to the right more, whereas FF,
Camino, (and MacIE5 just btw) have it more to the left. So I am
inclined not to think a bug.

It's this issue, which I explained before here:

http://groups.google.co.uk/group/alt...f0a4e2ba8dd70d
c/bd15dbc687d633a4?hl=en&lnk=st&q=#bd15dbc687d633a4
That was going to be my third thing when I found it! <gI knew
you had said things on this.
Definitely not a bug in Safari or Opera. Firefox's interpretation of the
spec is a bit weird I think but not technically wrong.

OP should just get rid of float: left on #header. Then it will be the
full width of its container, and so right floats will go all the way to
the right and left floats all the way to the left.
--
dorayme
Feb 7 '08 #5

P: n/a
Ben C wrote:
On 2008-02-07, dorayme <do************@optusnet.com.auwrote:
>In article <61*************@mid.individual.net>,
John <us**@example.netwrote:
>>Hi

Suppose I want a header containing an image floated left and a list of
horizontal links floated right.

So I float the image left. I then do the following with the list:

ul = float: right
li = display: inline
li a = display: block; float: left

I display: block on the a elements so I can apply vertical padding and
background images.

This works fine in IE6/IE7 and Firefox but not Safari for Windows, where
the list appears to lose its float: right property, and instead rests
against the right side of the image.

You can see a test case here:

http://www.lester1.eclipse.co.uk/test/

Is this a Safari float bug? How can I get the list to float right in Safari?
First thing to be said is that Safari, iCab and Opera line up
together on this and have the menu to the right more, whereas FF,
Camino, (and MacIE5 just btw) have it more to the left. So I am
inclined not to think a bug.

It's this issue, which I explained before here:

http://groups.google.co.uk/group/alt...15dbc687d633a4

Definitely not a bug in Safari or Opera. Firefox's interpretation of the
spec is a bit weird I think but not technically wrong.

OP should just get rid of float: left on #header. Then it will be the
full width of its container, and so right floats will go all the way to
the right and left floats all the way to the left.
Or I could just put width: 100%; on #header?

The header is floated left to make its height dependent on the floated
elements inside.
Feb 8 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.