I have read ::before
is used to add content before the element you use it with, e.g.
p::before {
content: "Read this: ";
}
but most of the times I have seen (peeking at web pages through developer tools) they use them without any element, e.g.
<div class="btn-toolbar" role="toolbar">
::before
<div class="btn-group">
<button type="button" class="btn btn-default"><span class="glyphicon glyphicon-align-left"></span></button>
<button type="button" class="btn btn-default"><span class="glyphicon glyphicon-align-center"></span></button>
<button type="button" class="btn btn-default"><span class="glyphicon glyphicon-align-right"></span></button>
<button type="button" class="btn btn-default"><span class="glyphicon glyphicon-align-justify"></span></button>
</div>
::after
</div>
Surprisingly when you look at web page source code these ::before
or ::after
elements are not displayed.
Why are they shown in developer tools?