Why do the :before and :after pseudo-elements require a 'content' property?

后端 未结 5 1159
眼角桃花
眼角桃花 2020-11-22 13:36

Given the following scenario, why does the :after selector require a content property to function?

5条回答
  •  情歌与酒
    2020-11-22 14:11

    Until you add content: ..., the psuedo-element doesn't actually exist.

    Setting other style properties is not enough to force the browser to create the element.

提交回复
热议问题