Ecco un esempio che considera le icone come parte dello stile (e quindi non nel markup): http://jsbin.com/aVIjAcO/1/edit
markup
codice:
<div class="withicon">
For now, since by many prolonged, repeated experiences, I have perceived that in all cases man must eventually lower, or at least shift, his conceit of attainable felicity; not placing it anywhere in the intellect or the fancy; but in the wife, the heart, the bed, the table, the saddle, the fireside, the country; now that I have perceived all this, I am ready to squeeze case eternally. </p>
In thoughts of the visions of the night, I saw long rows of angels in paradise. Now, while discoursing, it behooves to speak of other things akin to it.</p>
</div>
Css
codice:
.withicon {
position: relative;
padding: 0 30px;
}
.withicon:before,
.withicon:after {
content: "";
position: absolute;
top: 50%;
margin-top: -8px;
border: 1px #ccc solid;
width: 16px;
height: 16px;
display: inline-block;
}
.withicon:before { left:0; background: url(iconadestra.png) top let no-repeat; }
.withicon:after { right:0; background: url(iconasinistra.png) top let no-repeat; }
le icone restano centrate verticalmente rispetto all'ampiezza del testo che le contiene