CSS text-underline-position

The CSS text-underline-position property is used to define the position of text-decoration-line (line used to decorate the text). For example:

HTML with CSS Code
<!DOCTYPE html>
<html>
<head>
   <style>
      p{text-decoration-line: underline;
        text-underline-position: under;}
   </style>
</head>
<body>
   
   <h2>The text-underline-position Property</h2>
   <p>This is an example of text-underline-position property in CSS</p>
   
</body>
</html>
Output

The text-underline-position Property

This is an example of text-underline-position property in CSS

After removing the following CSS code, from above example:

text-underline-position: under;

The output of the underlined paragraph would be:

This is an example of text-underline-position property in CSS

CSS text-underline-position Example

The syntax of text-underline-position property in CSS, is:

text-underline-position: x;

The value of x should be any of the following:

The text-underline-position: under; is used most of the time to ensure complete viewing of the text.

CSS Online Test


« Previous Tutorial Next Tutorial »