FF Problem With Extend Fixed Width ,height

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ealireza
    New Member
    • Jan 2008
    • 3

    FF Problem With Extend Fixed Width ,height

    i want to Increase Parent Div Size from Child
    it work on IE ,
    i also Try with
    Code:
    Clear:both
    style
    and
    Code:
    <br clear=all>
    tag
    but not get work on FF

    this is Sample Code Have Problem
    Code:
    <div style="width:0;height:0;background-color:Black;padding:20px;">
    
    	<div style="width:150px;height:150px;background-color:red">
    		x
    	</div>
    
    </div>
    Please guidance me to find solution
    thank you
    alireza
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    Don't complain that FF is doing this wrong when you tell it to have zero height and zero width and it does what you said while IE does not. As always, IE is in the wrong here while Firefox is performing correctly.

    IE treats height and width as 'min-height' and min-width, which is why it does this wrong. Of course, min-height doesn't work at all.

    Comment

    • Ealireza
      New Member
      • Jan 2008
      • 3

      #3
      Originally posted by drhowarddrfine
      Don't complain that FF is doing this wrong when you tell it to have zero height and zero width and it does what you said while IE does not. As always, IE is in the wrong here while Firefox is performing correctly.

      IE treats height and width as 'min-height' and min-width, which is why it does this wrong. Of course, min-height doesn't work at all.
      thank you
      i try to use Min width but not work
      Code:
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml" >
      <head>
      <style type="text/css">
      .a 
      {
      
      background-color:Black;
      padding:20px;
      min-width:2px;
      max-width:600px
      }
      </style>
      </head>
      <body>
      <div class="a">
      
      	<div style="width:150px;height:150px;background-color:red">
      		x
      	</div>
      </div>
      </body>
      </html>
      please correct my codes to find solution
      thank you

      Comment

      • Ealireza
        New Member
        • Jan 2008
        • 3

        #4
        finally i find solution to solve this problem

        just define Display type of Element as Table ;)

        i put it here maybe useful for some body

        Code:
        <div style="width:0;background-color:Black;padding:20px;display:table">
        
        	<div style="width:150px;height:150px;background-color:red">
        
        	</div>
        <div style="clear:both"></div>
        </div>

        Comment

        • drhowarddrfine
          Recognized Expert Expert
          • Sep 2006
          • 7434

          #5
          Originally posted by Ealireza
          thank you
          i try to use Min width but not work
          Well, yes, min-width doesn't work in IE either; only modern browsers.

          display:table is not what I would have done but....

          Comment

          Working...