property

Text decoration inset — CSS reference

Adjusts the ends of decoration lines along the inline direction. A positive length shortens the line and a negative length extends it. Two lengths allow independent start/end adjustments. It does not change the size of the text box; the regular underline is a useful fallback.

Formal Syntax & Structure

css syntaxcss
text-decoration-inset: 4px;

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>text-decoration-inset</title><style>body{margin:0;background:white}#a{box-sizing:border-box}#a{text-decoration:underline;text-decoration-inset:4px}</style><body><span id="a">Decorated label</span></body></html>
CSS Reference