By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,785 Members | 1,072 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,785 IT Pros & Developers. It's quick & easy.

FF Problem With Extend Fixed Width ,height

P: 3
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
Share this Question
Share on Google+
4 Replies


drhowarddrfine
Expert 5K+
P: 7,435
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

P: 3
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

P: 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
Expert 5K+
P: 7,435
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.