I want to get a css effect like a highlighter
I found some answers like Pen highlighter effect in css. But how could I get this highlighter effect in smaller as you can see in the example ?
I want to get a css effect like a highlighter
I found some answers like Pen highlighter effect in css. But how could I get this highlighter effect in smaller as you can see in the example ?
I would use an ::after pseudo element to do the highlight. Here is an example:
.highlight {
position: relative;
}
.highlight::after {
content: " ";
left: 0;
right: 0;
position: absolute;
bottom: 1px;
height: 6px;
background-color: #9bffb0a6;
z-index: -1;
}
<div><span class="highlight">Cloud Native</span>: Cloud Training, Cloud Development, Cloud Architecture, Cloud Assesment....</div>
Just the .highlight class for any text you want to highlight.
You can do it like this
.underline span {
display: inline-block;
background-position-y: -0%;
background-image: linear-gradient( transparent 50%, #0095ff 50%);
transition: background .3s ease;
background-size: 2px;
background-size: auto 175%;
text-decoration: none;
font-weight: 600;
}
<p class="underline">
This sentence has <span>Highlighted Text</span> in the middle.
</p>