The ::before notation (with two colons) was introduced in CSS3 in order to establish a discrimination between pseudo-classes and pseudo-elements. Browsers also accept the notation :before introduced in CSS 2.

The code marked @Before is executed before each test, while @BeforeClass runs once before the entire test fixture. If your test class has ten tests, @Before code will be executed ten times, but @BeforeClass will be executed only once. In general, you use @BeforeClass when multiple tests need to share the same computationally expensive setup code. Establishing a database connection falls into ...

However, all before hooks that apply are executed before any beforeEach hook. This explains the order above: sublevel before executes before top beforeEach because it is a before hook. And with after and afterEach, the same logic applies but the the order is reversed: all afterEach hooks that apply are executed before any after hook.

Since :before is a pseudo element, you can't have html content, only text.

Explains the purpose and functionality of :before and :after pseudo-elements in CSS.

So I read the docs and probably understand the purpose of ::before and ::after. If my understanding is correct, they should always work in combination with other elements. But the web page I'm look...

Hence, a:hover::before and a:visited::before. But if you're developing for legacy browsers such as IE8 and older, then you can get away with using single colons just fine. This specific order of pseudo-classes and pseudo-elements is stated in the spec: One pseudo-element may be appended to the last sequence of simple selectors in a selector.