HTML & CSS
margin: 0 0 0 0;
border: 1px solid #1d1d1d;
to this code width not auto and is 100%.
i want-> width: auto;
i not want use position:absolute; or float.
Do you have idea to solve this problem?
If you don't set a width, it defaults to auto. I think maybe you need to show the context of this code, and tell us what you want to see.
[Moved to CSS forum.]
on a block element, width:auto IS 100% with padding included. in order for it to "shrinkwrap" you need to use float, position:absolute OR display:inline ( or inline-block).
Then I would lean towards display:inline-block; since you are setting a height on it.
As dresden_phoenix mentioned, it is a shrinkwrapping element that will expand to the width of it's content. It is also capable of taking dimensions like a block level element.
Thank you, i use of this and worked.
Note that inline-table won't work for IE7 and under though so inline-block may have been a better choice as there is a hack to make it work in IE7 and under also - if you are interested
This topic is now closed. New replies are no longer allowed.