Answers for "set distance between text and underline"

CSS
0

set distance between text and underline

{
   text-decoration: underline;
   text-underline-offset: 2px;
}

Here, text-underline-offset: 2px;  is used to define the distance of the underline from the text, where "2px" is the distance.

Note: text-underline-offset: 2px;  can only be used after 
                  text-decoration: underline;

You can also change the thickness of underline by writing
                   text-decoration: underline 5px;
where "5px" is the thickness.
Posted by: Guest on April-04-2022

Code answers related to "set distance between text and underline"

Browse Popular Code Answers by Language