I’m trying to add a bottom border to a title thats wrapped within a div but it affects the whole block.
<div class="title">I'm a title</div>
and my CSS
.title {border-bottom: 2px solid #000; padding-bottom: 3px;}
Is the best way to apply this border to the text?
Wrapping a span around the text would be ideal. But I can’t access the HTML.
<div class="title">
<span class="border">I'm a title</span>
</div>
How would I wrap the text with a span using Jquery.
I’m trying
$(".title").wrap('<span></span>');
Or is there another way to add this CSS?
Thanks
“…How would I wrap the text with a span using Jquery.”
This should answer your question: