{"id":198664,"date":"2015-04-03T09:37:29","date_gmt":"2015-04-03T16:37:29","guid":{"rendered":"http:\/\/css-tricks.com\/?page_id=198664"},"modified":"2021-08-02T11:17:53","modified_gmt":"2021-08-02T18:17:53","slug":"text-underline-position","status":"publish","type":"page","link":"https:\/\/css-tricks.com\/almanac\/properties\/t\/text-underline-position\/","title":{"rendered":"text-underline-position"},"content":{"rendered":"\n
The These are the values specified in the W3C CSS Text Decoration Module Level 3 Candidate Recommendation:<\/p>\n\n\n\n Microsoft uses a different set of values for Internet Explorer:<\/p>\n\n\n\n At the time of this writing, This demo shows the text-underline-position<\/code> property sets the placement of the underline on links or on text with
text-decoration<\/a>: underline;<\/code> applied.<\/p>\n\n\n\n
.element {\n text-underline-position: under;\n}<\/code><\/pre>\n\n\n
Values<\/h3>\n\n\n
auto<\/code>: the default. The browser will decide between placing the underline at the text’s baseline or under it.<\/li>
inherit<\/code>: inherits the underline position of the parent.<\/li>
under<\/code>: places the underline under the text with extra space to prevent crossing descenders.<\/li>
left<\/code>: for vertical writing modes. This places the line to the left of the text.<\/li>
right<\/code>: for vertical writing modes. This places the line to the right of the text.<\/li><\/ul>\n\n\n\n
auto<\/code>: the default. Places the underline below the text for all languages except Japanese (see the MSDN link in the “More Information” section below for details).<\/li>
above<\/code>: positions the underline above the text. Visually identical to
text-decoration<\/a>: overline;<\/code><\/li>
below<\/code>: positions the underline below the text. Note that this is different from
under<\/code> \u2014 it will not clear descenders.<\/li>
auto-pos<\/code> works the same as the MS implementation of
auto<\/code>.<\/li><\/ul>\n\n\n
Demo<\/h3>\n\n\n
text-underline-position<\/code> is only partially supported by Chrome (33+ with experimental flags enabled) and Internet Explorer 6+. Chrome supports the
auto<\/code>,
inherit<\/code>, and
under<\/code> values from the W3C candidate recommendation, while IE supports its own alternate values.<\/p>\n\n\n\n
under<\/code> and
below<\/code> values in the browsers that support them.<\/p>\n\n\n\n