I might be misunderstanding but why do you want the container width to be 300px wide and expect the 400px input box to not poke out the side? If you stick a large box in a small bag the box will have to poke out the top of the bag....
~ Lacuna -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of tao yang Sent: 07 August 2007 08:30 To: css-d@lists.css-discuss.org Subject: [css-d] How a div can expand according to its content? Hi all. I am a new guy in this list, and this is my first e-mail.When I write the HTML, I met a problem: when I put a <input type=text> with width, for example 400px, into a Div with a shorter width(300px), the Input will poke the right edge of the div. In IE6, this will not happen.input is wrapped just well in div. I know this is IE6'bug, but that's the way I want.In firefox and IE7, disaster happen, <input> just poke the Div'right edge. I try to use the style "display: table-cell" to the outer div, firefox works well. But IE7 dosen't support this table-cell. I wonder if there is a way for IE7 which could fix the problem?Thank you very much. And here is the HTML files. ------------------------------------HTML----------------------------------- <!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" xml:lang="en"> <head><title> test文件 </title> <link href="basic.css" type="text/css" rel="stylesheet" /> <style type="text/css"> </style> </head> <body> <div id="tdd" style="width: 400px; max-width: 600px;background: red; height: 50px; display: table-cell"> <form> <input name="df" id="df" type="text" style="width:600px;"/> </form> </div> </body> </html> --------------------------------------------------------------------------------- Thanks again for tolerating my poor ENGLISH. --------------------------------- 抢注雅虎免费邮箱3.5G容量,20M附件!
______________________________________________________________________ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7 information -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/