Is it possible to achieve a
-like effect without using the
tag?

前端 未结 9 2315
春和景丽
春和景丽 2020-12-01 06:03

I personally like the

tag because of how it draws a box and puts the at the top of it, over the border. Like this.

9条回答
  •  心在旅途
    2020-12-01 06:39

    Use ::before pseudoelement to generate the top border of the emulated

    , then position the emulated element over the ::before block with z-index and position properties. Lastly, use gradient and a solid color-stop on the top of the emulated fieldset, setting the top color of the linear gradient to transparent so whatever background is behind the fake fieldset will be visible.

提交回复
热议问题