<p>
<p>
Creating a Thick Underline Behind Text with CSS
<p>To achieve the effect of a thick underline behind text using spans and CSS, there are a few techniques you can employ:
<p>
Option 1: Nested Spans
<p>This approach involves nesting a series of spans, each with increasing bottom borders in size and color:
<p>
Option 2: Box Shadow<p>Another option is to use box shadow to create the underline:
p {
font-size: 100px;
font-family: arial;
}
span {
padding: 0 10px;
box-shadow: inset 0 -0.4em 0 0 magenta;
}
span:nth-child(2) {
box-shadow: inset 0 -0.55em 0 0 magenta;
}
span:nth-child(3) {
box-shadow: inset 0 -0.7em 0 0 magenta;
}
Copy after login
<p>With these methods, you can create the illusion of a thick underline behind your text, either above or below the baseline.
The above is the detailed content of How Can I Create a Thick Underline Behind Text Using CSS?. For more information, please follow other related articles on the PHP Chinese website!