Используйте псевдоэлемент:
p{
font-size: 30px;
line-height: 30px;
}
.primary-underline{
text-decoration: none;
display: inline-block;
position:relative;
z-index:0;
}
.primary-underline:before {
content:"";
position:absolute;
z-index:-1;
bottom:0;
left:0;
height:10px;
width:100%;
border-radius:10px;
background:#06CC6B;
}
<p>Nous aidons les artisans, commerçants, startups et PME à
<span class="primary-underline">augmenter</span> leur
<span class="primary-underline">visibilité sur internet</span></p>
Или вы можете рассмотреть несколько фонов:
p{
font-size: 30px;
line-height: 30px;
}
.primary-underline{
text-decoration: none;
display: inline-block;
background:
radial-gradient(farthest-side, #06CC6B 98%,transparent 100%) bottom right/10px 10px,
radial-gradient(farthest-side, #06CC6B 98%,transparent 100%) bottom left /10px 10px,
linear-gradient(#06CC6B,#06CC6B) bottom/calc(100% - 10px) 10px;
background-repeat:no-repeat;
}
<p>Nous aidons les artisans, commerçants, startups et PME à
<span class="primary-underline">augmenter</span> leur
<span class="primary-underline">visibilité sur internet</span></p>
И с некоторыми переменными CSS для лучшего контроля:
p{
font-size: 30px;
line-height: 30px;
}
.primary-underline{
--s:10px; /* height of the line */
--c:#06CC6B; /* color*/
text-decoration: none;
display: inline-block;
background:
radial-gradient(farthest-side, var(--c) 98%,transparent 100%) bottom right/var(--s) var(--s),
radial-gradient(farthest-side, var(--c) 98%,transparent 100%) bottom left /var(--s) var(--s),
linear-gradient(var(--c),var(--c)) bottom/calc(100% - var(--s)) var(--s);
background-repeat:no-repeat;
}
<p>Nous aidons les artisans, commerçants, startups et PME à
<span class="primary-underline">augmenter</span> leur
<span class="primary-underline" style="--s:15px;--c:pink">visibilité sur internet</span> et aussi à <span class="primary-underline" style="--s:5px;--c:orange;">faire autre chose</span></p>