I would like to normalize the spacing between line breaks and paragraphs in some text.
To do this, I want to collapse all line breaks so that they do not display the height by themselves, and then add margin-bottom to the last of two consecutive tags <br>
.
Is there a css selector that allows me to select the last tag <br>
that falls into pairs inside <p>
?
<p>
Some text<br />
Some more text<br /><br />
Even more text<br />
</p>
I tried the following selectors, but not cubes. It seems that selector + ignores the text and becomes greedy.
p br {
line-height: 0;
height:0;
margin:0;
padding:0;
content: " ";
display: block;
}
p br + br {
margin-bottom: 1em;
}
Example: http://jsfiddle.net/jqcyc/
Is this possible with this markup, preferably without javascript?