468,236 Members | 1,924 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,236 developers. It's quick & easy.

FF Problem With Extend Fixed Width ,height

i want to Increase Parent Div Size from Child
it work on IE ,
i also Try with
Expand|Select|Wrap|Line Numbers
  1. Clear:both
style
and
Expand|Select|Wrap|Line Numbers
  1. <br clear=all>
tag
but not get work on FF

this is Sample Code Have Problem
Expand|Select|Wrap|Line Numbers
  1. <div style="width:0;height:0;background-color:Black;padding:20px;">
  2.  
  3.     <div style="width:150px;height:150px;background-color:red">
  4.         x
  5.     </div>
  6.  
  7. </div>
Please guidance me to find solution
thank you
alireza
Jan 24 '08 #1
4 1376
drhowarddrfine
7,435 Expert 4TB
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.
Jan 24 '08 #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.
thank you
i try to use Min width but not work
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" >
  3. <head>
  4. <style type="text/css">
  5. .a 
  6. {
  7.  
  8. background-color:Black;
  9. padding:20px;
  10. min-width:2px;
  11. max-width:600px
  12. }
  13. </style>
  14. </head>
  15. <body>
  16. <div class="a">
  17.  
  18.     <div style="width:150px;height:150px;background-color:red">
  19.         x
  20.     </div>
  21. </div>
  22. </body>
  23. </html>
please correct my codes to find solution
thank you
Jan 24 '08 #3
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

Expand|Select|Wrap|Line Numbers
  1. <div style="width:0;background-color:Black;padding:20px;display:table">
  2.  
  3.     <div style="width:150px;height:150px;background-color:red">
  4.  
  5.     </div>
  6. <div style="clear:both"></div>
  7. </div>
Jan 24 '08 #4
drhowarddrfine
7,435 Expert 4TB
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....
Jan 24 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Jaz | last post: by
33 posts views Thread by Joe | last post: by
25 posts views Thread by Michael Schuerig | last post: by
1 post views Thread by donpro | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.