SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2003
    Location
    Philippines
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    IMG Align="left" going out of <div> in Mozilla

    ok so I have a div and it has a <img src="" align="left" /> in it so theres an image with text that wraps around. At first it didnt work in IE, so I did the holly hack 1% height, but it doesnt work in mozilla or opera... unless there is enough text to match the height of the image. how come?

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,288
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    We'd need to see the code to solve this for you.

    I'd recommend using float:left for your images instead of the deprecated align but thats probably nothing to do with your problem anyway.

    You say you used the holly hack of height:1% but have you hidden it from mozilla because moz will obey height and make the element 1% high only.

    If images don't show in ie then its usually position:relative that fixes it and is less harmful to other browsers and doesn't need to be hidden.

    If you could provide the code I'm sure it could be solved in seconds

    Paul

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2003
    Location
    Philippines
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well I've tried both align and float: left, seems to have the same effect. The holly hack is hidden from Mozilla and Mac IE.
    Here's my container DIV
    Code:
    	#main .content
    	{
    		font-size: 12px;
    		padding: 4px;
    		color: #000000;
    		margin: 2px;				
    	}
    		/* Hides from IE-mac \*/
    		* html #main .content {height: 1%;}
    		/* End hide from IE-mac */
    and in the <div> I have
    Code:
    <img src="image.gif" align="left" hspace="5" />one line of text
    btw thanks Paul, you are a relentless poster and helper. You could compile all your fixes here and make a book

  4. #4
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,288
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    The problem is not with the code above because on its own it works as expected even without the height hack.

    Therefore the problem probably lies above in one of the parents or previous styles.

    If you have a link then it would be easier to work out whats going on. (You can PM me the link if its online abut not ready for general view).

    Alternatively I'd need a larger chunk of code and css to determine exactly whats going on.

    You could compile all your fixes here and make a book
    lol - I'm sure theres probably enough material for a book in here, which is why sitepoint forums are such a good resource

    Paul


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •