body {
max-width: 300px;
}
.highlight {
background-color: #ee3;
display: flex;
}
<div>
Lorem ipsum<p class="highlight">lorem ipsum</p>
Lorem ipsum
</div>
I like that the p
inside div
creates new lines that separate between each paragraph rather than the span
that doesn't. But I want the highlighted text don't expands to the entire element. I'm trying to find out with several display
properties but i'm stuck.
Thank you