Mr. Harun’s shop banner with a link and a BARU badge: set the text-decoration longhands or swap in a border or gradient, measure the real baseline, then find…
A tidy link underline (brand colour, a little offset) reads better, wavy marks misspellings, line-through strikes prices. Knowing the longhands means no border-bottom hacks, and knowing why a link’s child still gets the line.
The line is drawn from the letters, and belongs to the element that declared it
border-bottom looks stiff and ignores the letters border-bottom is painted at the inline box’s bottom edge, below the font’s descent, and leaves no gaps at the tails. Use text-decoration with text-underline-offset and text-decoration-thickness: it is placed from the baseline and skip-ink breaks it around the tails.text-decoration-style has solid, double, dotted, dashed and wavy; its colour and thickness are set separately with text-decoration-color and text-decoration-thickness.background-image: linear-gradient(...) as tall as the line, then transition background-size from 0% 2px to 100% 2px.wavy, then to dotted The line’s shape changes; its position still comes from the baseline.text-underline-offset to 4px or more The mark left of the line shows its distance from the measured baseline.text-decoration-skip-ink: none The line is no longer broken and cuts the tails of p, g, y.border-bottom The line moves below the descent and leaves no gaps at any letter.