I've always used :before in CSS to mean put content before the selector. I've never had any problems with this, however, I've stumbled across something that is confusing me where a selector's :before is appending inside the element instead of coming before it. I don't see why this is the case.
Here is a fiddle: http://jsfiddle.net/vMtct/1/
And here is the basic code:
<div class="block">
<p>But this <p> will have content <em>before</em>.</p>
</div>
.block {
margin: 0 auto;
width: 250px;
height: 250px;
background: #ffffff;
border: 1px solid #cccccc;
padding: 50px; }
.block:before {
background: #eeeeee;
content: "Here is something that print's inside the selector";
display: block;
padding: 20px;
margin-bottom: 20px; }
p:before {
display: block;
content: ">>>"; }
"before content" content
which is why it appears actually before. Got it. I guess adding some styles tocould have shown that.
– o_O Jul 11 '13 at 00:46