开发者

<fieldset>'s width in html [duplicate]

This question already has answers here: Is there any way to have a fieldset width only be as wide as the controls in them? (12 answers) 开发者_如何学Python Closed 5 years ago.

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">
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜