Better choice than... text-decoration: underline The descendants do not cut the underline. The machine is implemented as text-decoration-skip-ink: auto but it has less control over the underline.
HTML CODE:
<p class="pretty-text-underline">
Pretty text underline without clipping descending letters.
</p>
CSS CODE:
.pretty-text-underline {
font-family: Arial, sans-serif;
display: inline;
font-size: 18px;
text-shadow: 1px 1px 0 #f5f6f9, -1px 1px 0 #f5f6f9, -1px -1px 0 #f5f6f9, 1px -1px 0 #f5f6f9;
background-image: linear-gradient(90deg, currentColor 100%, transparent 100%);
background-position: 0 0.98em;
background-repeat: repeat-x;
background-size: 1px 1px;
}
.pretty-text-underline::-moz-selection {
background-color: rgba(0, 150, 255, 0.3);
text-shadow: none;
}
.pretty-text-underline::selection {
background-color: rgba(0, 150, 255, 0.3);
text-shadow: none;
}
Description
- text-shadow: ... Has 4 offset values, covering the 4x 4 px area to ensure that the underline has a "thick" shadow that covers the offspring's underlined line. Use a color that matches the background. For larger fonts, use a larger font px size.
- background-image: linear-gradient(...)currentColor Create a 90 degree gradient using the current text color ( ).
- background-* The property sets the size of the gradient to 1x1px and repeats along the x axis.
- ::selection The pseudo selector ensures that text shadows do not interfere with text selection.
Post your comments / questions
Recent Article
- How to get domain name information from a Domain using Python
- ModulenotFoundError: no module named 'debug_toolbar' -SOLUTION
- How to create superuser in django project hosted in cPanel without terminal
- CSS & images not loading in django admin | cpanel without terminal
- Could not build wheels for mysqlclient, which is required to install pyproject.toml-based projects
- How to sell domain name on Godaddy (2023)
- TemplateSyntaxError at / Could not parse the remainder: ' + 1' from 'forloop.counter0 + 1'
- urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'OpenSSL 1.0
Related Article