I want to set the background color only of a justified text (like when the text is selected by the mouse)
I've tried with div
,
or span
inside div
,
or p
without margin
,
or h1
display inline,
but no one of these solutions solved my problem.
I don't mean the ::selection
pseudo, but the text background that is always displayed
I want exactly this:
Please help
You can try this
HTML
<div class="CC ">
<div class="bg">Lorem ipsum dolor sit amet</div>
</div>
CSS
.bg {
background-color:red;
display:inline;
padding: 1px 0
}