Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
CSS Floats not working properly in FireFox
Old 08-10-2009, 08:41 AM CSS Floats not working properly in FireFox
Junior Talker

Posts: 1
Name: Emma
Trades: 0
Hello everyone,

I've got this problem with Floats in Firefox. I've come accross this problem many times but have never really found a solution.

The problem is, my div that is floated to the right always seems to drop down underneath the div that's floated to the left. However, this problem doesn't always happen... sometimes the page loads fine but when you refresh the problem occurs.

Obviously, I can't just leave it the way it is.

Here is my CSS:

Code:
.float_left {
 float: left;
}
.float_right {
 float: right;
 text-align: left;
}
.clear {
 clear: both;
}
 
.product_categories {
 width: 159px; 
 margin-left: 3px;
 border: 1px solid red; 
}
.products {
 width: 678px; 
 border: 1px solid red; 
 margin-right: 3px; 
 margin-left: 6px;
}
The red borders are a guide for me to see where the DIVs sit.

Here is the HTML:

HTML Code:
 
<div id="main_wrapper">
 <div id="header">
    
        <div class="float_left">
            <img src="images/shoppingbasket.jpg" alt="Shopping Basket" />
        </div>
            
        <div class="float_left top_links">
         <a href="#">0 Items in your Shopping Basket</a>
        </div>
        
        <div class="float_right top_links">
            
             <li><a href="#">Your Account</a></li>
                <li>|</li>
                <li><a href="#">Sign In</a></li>
            
        </div>
        
        <div class="clear"></div>
        
        <div class="sub_top_links">
        
            <a href="#">Customer Service</a> |
            <a href="#">About Us</a>   |   
            <a href="#">Store Locator</a>
            
        </div>
    
    </div>    
        
    <div id="nav_wrapper">
     
       <div id="main_nav_search">      
              
           <div class="float_right search_holder">                
                    <table width="253" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td>
                        <div class="search_textfield_bg">
                            <input name="search" type="text" border="none" class="search_textfield" value="Search... " />
                         </div> 
                         </td>
                        <td><input name="submit" type="image" src="images/go.jpg" /></td>
                      </tr>
                    </table>
                </div>
                   
             <li class="main_nav_cats"><a href="#">Women</a></li> 
                <li class="main_nav_cats"><a href="#">Girls</a></li> 
                <li class="main_nav_cats"><a href="#">Baby</a></li>
                <li class="main_nav_gen"><a href="#">Press</a></li> 
                <li class="main_nav_gen"><a href="#">Video</a></li> 
                <li class="main_nav_gen"><a href="#">News</a></li> 
                 
        </div>
        
       
        
        <div class="clear"></div>
        
    </div>
    
    <div id="content_wrapper">
    
  <div class="float_left product_categories"> 
         <div style="background-image:url(images/product_category_bg.jpg);">
             <div class="title">
             Products
             </div>
                .................
            </div><img src="images/product_category_bot.jpg" /></div>
        
        
        <div class="float_right products">
        
         ...
            
         </div>
         
         <div class="clear"></div>
        
    </div>
    
</div>
 
I've only included the CSS for the parts that it's affecting. You can take a look at the problem here: http://emzi.dreamhosters.com/primp/products-by-cat.html

Any help would be much appreciated. Thank you
emzdesign is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-10-2009, 11:57 AM Re: CSS Floats not working properly in FireFox
racer x's Avatar
Ultra Talker

Posts: 457
Name: Randy
Location: Northern Wisconsin
Trades: 0
You need to clean up the code a bit. You have <li> items not inside <ul> or <ol>. Also, make sure ALL floated items have width defined.
racer x is offline
Reply With Quote
View Public Profile Visit racer x's homepage!
 
Old 08-10-2009, 12:42 PM Re: CSS Floats not working properly in FireFox
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
You also need to make sure that your TOTAL box width, which includes the box + borders + margins + padding does not exceed the width of the container they are in, in your case #main_wrapper. This is a common error amongst people new to css, they do not have a firm grasp on the box model. If you're getting a 'drop', it's more than likely due to total widths that exceed the available space.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to CSS Floats not working properly in FireFox
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.15487 seconds with 12 queries