:before
and :after
are pseudo elements, that are not actually added to the DOM. They are inserted before the content of the element.
It is also therefore that they don't work on 'empty' (self closing) elements like <input />
or <img/>
.
You could however get these pseudo elements to display 'outside' the element they are applied on, by positioning them absolute as demonstrated here: http://jsfiddle.net/vMtct/2/