<fieldset> width in html

I have a problem with the width of a set of fields. This is not automatic content tuning. It sets the width to the width of the screen. Is there a way to configure the auto-adjustment of the width of the contents of a field set?

+3
source share
5 answers

The field is the same size as the parent container, like any element of the block level, unless you give it a fixed width. Therefore you must do it display: inline-block.

+3
source

    <fieldset style="width:0px">

    </fieldset>
-1

0 Hml:

<fieldset class="field">
</fieldset>

Css:

.field {
    width: 0;
}
-1
source
<fieldset style="width:270px">
-2
source

Source: https://habr.com/ru/post/1763698/


All Articles