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

后端 未结 5 1212
眼角桃花
眼角桃花 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:02

    2020 Edit

    :before

    Is syntax from CSS2 for better practices you should write the newest syntax from CSS3 which is

    ::before

    with double semicolons

    Full answer and differences can be found here: What is the difference between :before and ::before?

提交回复
热议问题