The CSS `::before` selector can be used to insert some content, usually cosmetic, *before* the content of an element or elements. It is used by attaching `::before` to the element it is to be used on. It is an inline element by default.
In the example above we are prepending a grey border before every paragraph element on a page and we are also prepending the word "Comment: " in blue before every `span` element with the class name `comment`.
`::before` is one of the CSS pseudo-elements selectors, which are used to style specified parts of an element. In this case, we can insert content before some HTML element from CSS. Although we will see the content in the page, it is not part of the Document Object Model (DOM), which means that we cannot manipulate it from JavaScript.
There's a bit of discussion about the right way of using pseudo-elements: old style single-colon (`:before`), used in CSS specifications 1 and 2, versus CSS3 recommendation, double-colon (`::before`), mainly to "establish a discrimination between pseudo-classes and pseudo-elements". But for compatibility reasons, single-colon is still accepted. IE8 supports the single-colon notation only.