When to use :before or :after

≡放荡痞女 提交于 2019-12-04 14:09:19

The naming of ::before and ::after is not entirely arbitrary, but it only really makes sense when the content of those pseudo elements is displayed inline, just before or just after the content of the element they are attached to.

As soon as you use

position: absolute;

in a pseudo element (which is totally legitimate), it no longer matters whether that pseudo element is named ::before or ::after.

It might just as easily be named ::presentational-frill-1 or ::presentational-frill-2.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!