I have an issue with the width of a fieldset. It's not auto adjusting to it's content. It sets the width to the width of the screen. Is there a way to set it to auto adjust to the width of the content of the fieldset?
A fieldset is as large as the parent container, just like any block-level element, if you do not give it a fixed width.
So you have to make it display: inline-block
.
This should work
<fieldset style="width:0px">
</fieldset>
here is an example : http://www.pixy.cz/blogg/clanky/css-fieldsetandlabels.html
Sett the width to 0
Hml:
<fieldset class="field">
</fieldset>
Css:
.field {
width: 0;
}
<fieldset style="width:270px">
精彩评论