Html head title Title of the document.
How to style text decoration underline. The text-underline-offset property can be used to define how far the line is from the initial text. The CSS units as 1px 1em 1rem 1. This considers letterforms like g and p where lines drop beneath the usual line height.
You can use a variety of values as you might find in most CSS properties. It accepts any normal CSS colour value whether a keyword hexadecimal RGB RGBA HSL etc. In Lukas Horaks better text underline youll notice the bar underneath the text fits nicer into descending elements.
It looks something like this. We will create a class where we will use short-hand property text-decoration to style the underline. Ahover text-decoration.
If you want to add CSS underline on hover only use these CSS rules. What it was before auto. Next we will use text-underline-position and define it asunder.
Remove any set offset. This applies all the line styles to the textover-under-lines text-decoration. A cool text-decoration trick is combining each value.
With border-bottom you can also add a padding. Also the underline itself is pushed ever-so-slightly lower beneath the text so it takes on a new appearance compared to the browser default. Text-decoration-line text-decoration-color et text-decoration-style.