Is it possible / like me:
Remove padding when using CSS / before content selector / property?
eg. given the following code, how to make the bottom paragraph look like the top (without a space between content:before), but keep the indent in the paragraph.
Code: http://jsfiddle.net/569Ed/2/
HTML5:
<div class="no-padding">
<p>Paragraph</p>
</div>
<div class="padding">
<p>Paragraph</p>
</div>
CSS3:
p {
outline: 3px solid #fbb;
outline-top: 2px solid #fbb;
margin-bottom: 15px;
}
p:before {
content: 'Paragraph';
border: 1px solid #fbb;
background-color: #fbb;
display: block;
}
.padding p {
padding: 10px;
}
(this is only for the latest and largest browsers, so HTML5 and CSS3 / LESS are preferred)
Petah source
share