legend tag and Chrome

后端 未结 4 1104
故里飘歌
故里飘歌 2020-12-29 12:33

I\'ve looked everywhere but to no avail.

I got a in a form, which displays as I want in every browsers, except in Chrome. It\'s like it

4条回答
  •  清歌不尽
    2020-12-29 13:18

    This is a known issue with the legend element in webkit browsers. There are no clean workarounds for the legend element itself, but you could instead add the margin to the first element that follows the legend.

    Also, you'll have to explicitly set -webkit-margin-collapse: separate on that element to make it work properly. Try using this:

    legend + * {
      -webkit-margin-top-collapse: separate;
      margin-top: 10px;
    }
    

    http://jsfiddle.net/JLsPs/1/

    (answer found here: Cannot add `margin` to `` element in Safari & Chrome (WebKit))

提交回复
热议问题