What's the difference between the ::after and ::backdrop pseudo

Well, what the title says.

I really couldn't find any detailed information on it, the MDN documentation is also rather sparse if not useless..

Can you possibly give examples and tips when one is preferred over the other?

(https://developer.mozilla.org/en-US/docs/Web/CSS/::backdrop)


This pseudo-element is a box rendered immediately below the element (and above the element below the element in the stack, if any), within the same top layer.

As you see in the documentation you mentioned, it will add a new element between your actual element and the element after.

With ::after you can insert content after the content of your selected element (so the content is still add to the same element), see this example.

Pseudo element after documentation:

Insert content before, or after, the content of an element

Over that, there is a difference in what browsers can render the pseudo elements: Backdrop vs. After. As you can see, today (2016-02-19) you can use ::backdrop only in chrome, opera and android browser.

链接地址: http://www.djcxy.com/p/90414.html

上一篇: 有什么方法可以获得汽车的价值吗?

下一篇: :: after和::之间的区别是什么?