I need to highlight some texts in a paragraph but there are some constraints -
- The text outside of the highlights should also be on the same level as the highlighted text
- If there are multiple words consecutively then they come under a continuous highlight which can be easily achieved by just putting the whole thing in a tag
- If the text moves on to the next line there should be a gap in the highlight in between the two lines and not just a rectangle patch
- There should be enough distance between two lines such that it does not look messed up.
TLDR: I want something exactly like the image linked below. Thanks for the help.
This is what I have done
<p class="introduction">
Hi so<span>This is what I did but not sure how to go from here</span></p>
p.introduction {
width: 150px;
}
p.introduction span {
background-color: #f48024;
color: #1d1d1e;
border-radius: 25px;
float: left;
padding: 0 5px 0 5px;
}