If I want to put width
in a text to a div
And I want to set the 0
to width
in IE6 (I have not checked in IE 7) does not work !!!
Please check the HTML below:
& lt ;! DOCTYPE html public "- // W3C // DTD XHTML 1.0 Stronger // n http: // www. W3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> & Lt; Html xmlns = "http://www.w3.org/1999/xhtml" & gt; & Lt; Top & gt; & Lt; Title & gt; & Lt; / Title & gt; & Lt; Script src = "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js" type = "text / javascript" & gt; & Lt; / Script & gt; & Lt; Style & gt; # Box {width: 0 pixels; Background color: blue; } & Lt; / Style & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Div id = "box" & gt; & Lt; Span & gt; Hello & lt; / Span & gt; & Lt; / Div & gt; & Lt; Script & gt; . $ ("# Box") width (0); & Lt; / Script & gt; & Lt; / Body & gt; & Lt; / Html & gt; Width of div
width of div
comes in the minimum content.
Regards, Bookkeeper
By the time you do not hide it, the size of the fixed size will increase . If you can not use overflow: hidden
, then there is another way to do this:
& lt; Style & gt; # Box {status: relative; Width: 0; }} # Box Duration {Status: Completed; Left: -20px; } & Lt; / Style & gt; & Lt; Div id = "box" & gt; & Lt; Span & gt; Hello & lt; / Span & gt; & Lt; / Div & gt; Any element using the code:
Status: Absolute
is taken from the document stream and will not affect other elements including container size, which you do So the size of the dimensions you can expect.
Comments
Post a Comment