Hello, a curious bug appeared when I tried to make text with this effect:
Theproblemisinsmallerscreens,thesecondeffectintheadipiscingelittextwillsimplydisappear,dependingonthesizeofthetwo,asshownintheimagebelow:
CHANGE:ByanalyzingIrealizedthattheproblemisthewordbreakwiththeeffect,Isthereanywayaroundthis?
Belowisthecodeexample.
Toreproduce,simplyreducetheviewportofyourbrowser.
.color-primary {
color: #225cbe;
}
.featured-text {
position: relative;
font-weight: 900;
}
.featured-text:after {
content: "";
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 35%;
background-color: #fdd104;
z-index: -10;
}
<div class="main-title">
<p class="color-primary ">
<span class="featured-text">
Lorem Ipsum,
</span> dolor amit.
</p>
<p class="color-primary">
Consectetur,
<span class="featured-text">
adipiscing elit!
</span>
</p>
</div>