Reputation: 23563
With CSS3 is it possible to target a previous element?
So if i had this mark up:
<p>Target Me </p>
<p id="second">Second</p>
Something like this would make the text 'Target Me' bold:
#id -previous {
font-weight: bold;
}
Upvotes: 0
Views: 216
Reputation: 1341
One solution is to do it with jQuery. It would look something like
$("#second").prev().css('font-weight', 'bold');
Upvotes: 1