#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2008
    Posts
    8
    Rep Power
    0

    Unhappy Float Problem in Firefox - Fine in IE.


    Hi! Please help me again!

    I cannot figure this out. I have tried striping out everything out to see if I could figure out what was causing it -- I can't. This one part is not working - everything else is fine. When I take this out I have no problems.

    Basically, i'm trying to have an image with text next to it (without it wrapping around the image). In IE it works. In Firefox the text drops below the image.

    Here is the code stripped out. Unfortunately, I cannot access and FTP to upload this - but I don't think that should matter.

    Please, What am I doing wrong?

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
    <head>
    	<title>ARGH</title>
    </head>
    
    <body>
    
    <div style="margin-left:10px; margin-top:10px; width: 90%;">
    	<div style="float: left; padding-right: 10px;">
    		<img src="images/img.jpg" width="200px" height="100px" border="1">
    	</div>
    	<div style="float: left;">
    	Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc tellus purus, aliquet ut, posuere vitae, ullamcorper at, sapien. Donec vel sapien a lorem vehicula imperdiet. Aliquam a nunc sed lectus rhoncus imperdiet. Maecenas commodo scelerisque nulla.
    	</div>	
    </div>
    
    
    <div style="margin-left:10px; margin-top:10px; width:90%;">
    	<div style="float: left; padding-right: 10px;">
    		<img src="images/img.jpg" width="200px" height="100px" border="1">
    	</div>
    	<div style="float: left;">
    		Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc tellus purus, aliquet ut, posuere vitae, ullamcorper at, sapien. Donec vel sapien a lorem vehicula imperdiet. Aliquam a nunc sed lectus rhoncus imperdiet. Maecenas commodo scelerisque nulla. 
    	</div>	
    </div>
    
    <div style="clear: both;"></div>
    
    </body>
    </html>
  2. #2
  3. Eager to learn
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2009
    Location
    Maryland, USA
    Posts
    2,223
    Rep Power
    2184
    First of all what doesn't work? Please be more specific.

    Next, you should check your code by the validator. Your code contains 11 HTML Errors. Fix those first
    "Quality of responses may vary. I reserve the right to change my mind for any reason what-so-ever without admitting I was wrong. I'd prefer to change your mind however, it's easier on my ego". - jwdonahue

    "so no-one has actually bothered to post an original quote ? what's wrong with making up your own?"
    - marnixR

IMN logo majestic logo threadwatch logo seochat tools logo