I hide the tags brin my html on a mobile device, but would like only the last tag to brfunction normally. This seems to work if the element after the last bris an anchor tag.
I am using the following code:
p br {
display: none;
}
p br:last-child {
display: block;
}
<p>lorem
<br>loremlorem lorem
<br>
<br>READ ARTICLE IN JOURNAL</p>
<p>lorem
<br>loremlorem lorem
<br>
<br>
<a href="#">READ ARTICLE IN JOURNAL</a>
</p>
Run codeHide resulthttps://jsfiddle.net/5j8dtwfd/2/
css works as expected with the last brc tag display:blockapplied to it.
However, if I end the text “read article ..” in the anchor, css stops being able to find the latter br.
I'm not sure what is going on here to trigger this, is this the expected behavior?