Fieldset does not support display: table / table-cell

前端 未结 3 521
萌比男神i
萌比男神i 2020-12-06 17:50

I\'m trying to use display: table with fieldset, but it\'s not scaling properly. The same thing works if I change

to
3条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-06 18:07

    When you change the width of the fieldset, you are changing the size of the border of it. Its function is to group elements and draw a border around them. Its size doesn't affects the content inside it. So, follow this.

    .fieldset {
    display: table;
    padding:0;
    border:none;
    }
    .div {
    display:table-cell;
    border: 1px solid black;
    width:calc(100vw * 1/3);
    }
    1
    2
    3

提交回复
热议问题