Float problem with Firefox

This is a discussion on "Float problem with Firefox" within the Web Page Design section. This forum, and the thread "Float problem with Firefox are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Apr 4th, 2008, 10:40
Emzi's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Manchester
Age: 25
Posts: 155
Thanks: 0
Thanked 0 Times in 0 Posts
Float problem with Firefox

I didn't know whether to post this in the CSS or JS category, so apologies if this is in the wrong place.

I have added a widget from addthis.com to a site I'm currently working on putting together.

The widget sits within a DIV that has a float:left assigned to its class.

There is a DIV that has float:right next to it but since I implemented this widget the DIV with float:right seems to sit below the DIV with float:left in Firefox. In IE it looks fine.

This is the code used for the widget.

Code: Select all
 <a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[url]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()">
     <img src="http://s9.addthis.com/button1-bm.gif" width="125" height="16" border="0" alt="" /></a>
     <script type="text/javascript" src="java/addthis_widget.js"></script>
When I get rid of the script tags it looks fine so I think it's something wrong with the javascript. I downloaded the javascript and changed the widths of certain things in the file (some were set at 100%) and saved it to my server, but that still didn't work, so now I'm thinking there maybe a CSS solution to it?

Please take a look at: http://dev.enjoyonline.co.uk/mobilebucket/ to see it better than I'm explaining it

Ignore the black borders around the floated divs - I put them on to see where they were showing up in Firefox.

Anyone have any ideas on what I can do to solve the problem?

Thanks for your help in advance!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Apr 4th, 2008, 10:56
Most Reputable Member
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Float problem with Firefox

Start by validating your XHTML. Always, always do this when you encounter a bug (your CSS is fine, but should also be validated when bug-fixing).

I have the same widget on my site, and I have no problems controlling its positioning. I don't think it's a problem with the widget; I think it's a problem with your floats.

I believe the problem is actually pretty prosaic: you haven't allowed enough width for both floats to sit side-by-side!

Always allow a little "breathing room". Browser have different default formatting settings (such as text size), and this can slightly change the amount of space an element takes up.

So to fix the problem, simply reduce the width of your <div>s.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Apr 4th, 2008, 11:01
Emzi's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Manchester
Age: 25
Posts: 155
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Float problem with Firefox

Hi Mike,

Thanks for the input

I did change the widths to smaller sizes and that didn't work either. I even got rid of the widths to see if that would help, but alas it didn't work.

Validating is something I usually do when a page is finished but thank you for reminding me that I should also do it if I come accross any problems in the process, because it just might help me!

It sits perfectly when it's just the image (without the < script > tags), so I am wondering if FF doesn't like < script > tags in the HTML. I tried moving the < script > tags to be in the HEAD tags but the widget didn't like that and it stopped working.

Here's a link to the site without the < script > tags and just the image: http://dev.enjoyonline.co.uk/mobileb...outscript.html

Last edited by Emzi; Apr 4th, 2008 at 11:05. Reason: to add a link to a page without the script
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Apr 4th, 2008, 11:42
welshstew's Avatar
Site Admin

SuperMember
Join Date: May 2007
Location: inside the outside
Posts: 1,740
Blog Entries: 14
Thanks: 4
Thanked 33 Times in 31 Posts
Re: Float problem with Firefox

Emzi,
[edit] sorry didn't read your issue correctly, give me 5 [/edit]
Stew
__________________
WelshStew Site Admin
If you think I've helped, click the "Thanks"
tierney rides tboard - uk site | xtreme wales - extreme clothing
WebForumz - facebook | LinkedIn
Last Blog Entry: Phorm approved for UK rollout (Sep 17th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Apr 4th, 2008, 11:48
Most Reputable Member
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Float problem with Firefox

Okay, I just inspected your CSS and I think I've found the difference:

You have applied display: table to your div.top_nav_inner container. IE (incorrectly) ignores this -- it does not understand this display type. Firefox, however, correctly applies a table-layout to the <div>.

Try removing display: table. It seems to fix the problem.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Apr 4th, 2008, 11:49
welshstew's Avatar
Site Admin

SuperMember
Join Date: May 2007
Location: inside the outside
Posts: 1,740
Blog Entries: 14
Thanks: 4
Thanked 33 Times in 31 Posts
Re: Float problem with Firefox

change .top_nav_outer width from auto to 800px
change .top_nav_left and .top_nav_right width from 397px to 395px

and that seems to sort it all out

[edit]or try mikes solution[/edit]
__________________
WelshStew Site Admin
If you think I've helped, click the "Thanks"
tierney rides tboard - uk site | xtreme wales - extreme clothing
WebForumz - facebook | LinkedIn
Last Blog Entry: Phorm approved for UK rollout (Sep 17th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Apr 4th, 2008, 11:53
Emzi's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Manchester
Age: 25
Posts: 155
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Float problem with Firefox

Quote:
Originally Posted by MikeHopley View Post
Okay, I just inspected your CSS and I think I've found the difference:

You have applied display: table to your div.top_nav_inner container. IE (incorrectly) ignores this -- it does not understand this display type. Firefox, however, correctly applies a table-layout to the <div>.

Try removing display: table. It seems to fix the problem.

Ugh, I feel like such a berk (is that even a word?! ). Thank you so much! That did work!

I only apologise for not checking these things myself before asking for help!

Thank you again! I can now stop hitting my head against my desk
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Apr 4th, 2008, 11:54
Emzi's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Manchester
Age: 25
Posts: 155
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Float problem with Firefox

Quote:
Originally Posted by welshstew View Post
change .top_nav_outer width from auto to 800px
change .top_nav_left and .top_nav_right width from 397px to 395px

and that seems to sort it all out

[edit]or try mikes solution[/edit]
Thanks Mikes solution worked, but thank you
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Apr 4th, 2008, 11:56
Emzi's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Manchester
Age: 25
Posts: 155
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Float problem with Firefox

This thread is solved, but I can't seem to find the option that lets you choose that, so any mods if you can mark this thread as solved I'd really appreciate it (or point me in the right direction so I can do it myself )
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Apr 4th, 2008, 11:57
Most Reputable Member
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Float problem with Firefox

Quote:
Originally Posted by Emzi View Post
This thread is solved, but I can't seem to find the option that lets you choose that, so any mods if you can mark this thread as solved I'd really appreciate it (or point me in the right direction so I can do it myself )
Funnily enough, I was just looking for the same option -- and I can't find it. Has it vanished? I can only close threads, not mark them as solved.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Apr 4th, 2008, 12:02
welshstew's Avatar
Site Admin

SuperMember
Join Date: May 2007
Location: inside the outside
Posts: 1,740
Blog Entries: 14
Thanks: 4
Thanked 33 Times in 31 Posts
Re: Float problem with Firefox

that function has been disabled for the time being, you can however edit the title of the thread if you so wish
__________________
WelshStew Site Admin
If you think I've helped, click the "Thanks"
tierney rides tboard - uk site | xtreme wales - extreme clothing
WebForumz - facebook | LinkedIn
Last Blog Entry: Phorm approved for UK rollout (Sep 17th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
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 On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Float: Left with firefox magnetica Web Page Design 2 Aug 24th, 2007 16:55
css float problem milly Starting Out 3 Jul 9th, 2007 02:51
Margin different in IE and Firefox when using float cyberseed Web Page Design 8 Apr 17th, 2007 14:55
right float problem... c_martini Web Page Design 11 Aug 2nd, 2006 13:47
site ok in Firefox, not in IE : float problem?? bbbobo Web Page Design 1 Sep 30th, 2005 08:16


All times are GMT. The time now is 22:19.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved