1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Float Right not working in Firefox - going on 4 hrs+ to solve

Discussion in 'CSS' started by Lukas, Jul 30, 2006.

  1. #1
    works fine in IE but not Firefox.. I have floated other webpages on the website , just not this one..

    it's your basic CSS float with DIV's
    header
    left col : float left
    center col: float left
    right col: float right <<<<<< problem is here it stays left
    footer

    all looks fine except, "right col" overrides left col and renders links inaccessible. Again, IE is fine

    Details:
    body width is 740px

    there is a 4px right margin for "left" and "center"
    0 px margin for "right col"

    I originally thought is was a size problem but if IE shows it OK why does FF not.?

    why is this so frustrating. ?..

    I feel Like George Costanza getting upset :mad:


    -------------------------

    <DIV id=left col class=slot>
    <DIV><IMG
    src="images/tools.jpg" width="277" height="28"></DIV>
    <DIV class=copy>
    <UL>
    <LI><A href=>Trends </A>
    <LI><A href="">Check </A>
    <LI><A href="">M </A>
    <LI><A href="">W </A>
    <LI><A href=""> </A>
    </LI></UL><</DIV></DIV>

    <DIV id=center col class=slot>
    <DIV><IMG
    src="images/tools.jpg" width="277" height="28"></DIV>
    <DIV class=copy>
    <UL>
    <LI><A href=>Trends </A>
    <LI><A href="">Check </A>
    <LI><A href="">M </A>
    <LI><A href="">W </A>
    <LI><A href="">M </A>
    </LI></UL></DIV></DIV>

    <DIV id=right col class=slot>
    <DIV><IMG
    src="images/tools.jpg" width="177" height="28"></DIV>
    <DIV class=copy>
    <UL>
    <LI><A href=>Trends </A>
    <LI><A href="">Check </A>
    <LI><A href="">M </A>
    <LI><A href="">W </A>
    <LI><A href="">
    <IMG src="images/email.gif" width="23" height="18">&nbsp;Contact Us
    </A></LI></UL><br><br><br><br><br><br></DIV></DIV>


    -----------------------------

    in CSS code

    DIV.left col {
    FONT-SIZE: 0.7em; FLOAT: left; WIDTH: 277px; MARGIN-RIGHT: 4px
    }
    DIV.right col{
    FONT-SIZE; 0.7em; FLOAT: right; WIDTH: 178px; HEIGHT: 100%;
    }
    DIV.center col {
    FONT-SIZE: 0.7em; FLOAT: left; WIDTH: 277px; MARGIN-RIGHT: 4px
    }

    --------------------------

    I tried position: absolute....it didn't work....well it only worked for certain screen sizes 1024 x 768 bvut smaller or bigger it's out of position.


    tried <div align=right> in webpage and in css.

    thanks for any suggestions
     
    Lukas, Jul 30, 2006 IP
  2. Fast Hosty

    Fast Hosty Guest

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try swopping the top two round, ive had a problem of this nature before.
     
    Fast Hosty, Jul 30, 2006 IP
  3. Lukas

    Lukas Well-Known Member

    Messages:
    1,299
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    130
    #3
    tried that too.
    also the "center col" is the body content.

    you're right though it should be a simple solution
     
    Lukas, Jul 30, 2006 IP
  4. iteria

    iteria Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I see the problem. The divs have a class of "slot" and ids or either "right" "left" or "center" Well the simple answer is: You didn't define the classes right, left and center.

    I suggest this for a quick fix:

    CSS code:

    div.left {float:left;}
    div.right{float:right;}
    div.center{float:left;}

    html code:

    <div class="left"> some content</div>
    <div class="center"> some content</div>
    <div class="right"> some content</div>

    or this:

    css:
    #left {float:left;}
    #right{float:right;}
    #center{float:left;}

    html:
    <div id="left"> some content</div>
    <div id="center"> some content</div>
    <div id="right"> some content</div>
     
    iteria, Jul 30, 2006 IP
  5. Gordaen

    Gordaen Peon

    Messages:
    277
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You should use quotes around all of your attributes and not include spaces in CSS class names (and avoid starting them with numbers). As mentioned above: ".blah" = class of "blah" and "#lala" = id of "lala"
     
    Gordaen, Jul 31, 2006 IP
  6. Lukas

    Lukas Well-Known Member

    Messages:
    1,299
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    130
    #6
    still no go..

    I put in all quotes around all attributes...looked at each piece of code in css and html div's,no spaces no numebrs, chanegd ".div" to "#div"..and same thing.
    why it floats left instead of right is beyond me.

    this page code has beaten me into submission, too bad it's not a UFC website.
     
    Lukas, Jul 31, 2006 IP
  7. AdamSee

    AdamSee Well-Known Member

    Messages:
    422
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    135
    #7
    Can't you link to your page?
     
    AdamSee, Aug 1, 2006 IP
  8. tgo

    tgo Peon

    Messages:
    124
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Not an expert with CSS but why not just have them all float left then add a width. I think css allows % in the width. just make right and left 18% and the center 60%. I never float right for some reason.

    #left{
    	margin: 4px 4px 4px 4px;
    	padding: 2px;
    	border: 1px solid #000000;
    	width: 277px;
            float:left;
    	}
    #center{
    	margin: 4px 4px 4px 4px;
    	padding: 2px;
    	border: 1px solid #000000;
    	width: 277px;
            float:left;
    	}
    #right{
    	margin: 4px 4px 4px 4px;
    	padding: 2px;
    	border: 1px solid #000000;
    	width: 178px;
            float:left;
    	}
    
    Code (markup):
    then the html

    <DIV id="left">Text</DIV>
    <DIV id="center">Text</DIV>
    <DIV id="right">Text</DIV>
    Code (markup):
    displays
    |   L    |   C   | R |
    Code (markup):
    Hope this helps, if not, hey i tried. :p
     
    tgo, Aug 1, 2006 IP
  9. Lukas

    Lukas Well-Known Member

    Messages:
    1,299
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    130
    #9
    tried that too.

    for some reason the cenetr ( body content) then floats left, but under the "left" content and the right content (column floats left in the center columns place.
     
    Lukas, Aug 1, 2006 IP
  10. tgo

    tgo Peon

    Messages:
    124
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #10
    I have tested this, my code works.

    Attached is a example. Its just my code in a html page.

    It works in Firefox and IE so i dont know what you mean buy still no go.

    Attach the full code you are working on, its probably somewhere else in your code that is causing the problem.
     

    Attached Files:

    • test.html
      File size:
      559 bytes
      Views:
      1,444
    tgo, Aug 1, 2006 IP
  11. mrmckoy

    mrmckoy Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Did you try displaying them inline?
     
    mrmckoy, Oct 10, 2007 IP