Generator Tools
CSS Underline Generator
Build CSS underline styles with a live preview. Tune line, style, color, thickness, offset, and skip-ink. Copy CSS, React style, or Tailwind classes.
Quick presets
Live preview
Try a sentence with descenders (g, j, p, q, y) to see how the skip-ink setting affects the line under those glyphs.
Decoration controls
Line
Style
Color
Thickness
Browser picks a sensible default. Best for body text and links.
Underline offset
Browser positions the line at the font default. Only the underline line uses this property; overline and line-through ignore it.
Skip ink
Controls how the underline behaves where descenders (g, j, p, q, y) drop below the baseline. Most browsers default to auto.
CSS rule block
Drop directly into a stylesheet under any selector.
.underlined {
text-decoration: underline solid #2563eb;
text-decoration-thickness: auto;
text-underline-offset: auto;
text-decoration-skip-ink: auto;
}text-decoration shorthand
underline solid #2563eb
The shorthand carries line, style, and color. Thickness, offset, and skip-ink are not part of the shorthand; the rule block above sets them as separate properties.
Inline declaration
text-decoration: underline solid #2563eb; text-decoration-thickness: auto; text-underline-offset: auto; text-decoration-skip-ink: auto;
One-line form for CSS-in-JS, style attributes, and quick paste tests.
React style object
{
textDecoration: "underline solid #2563eb",
textDecorationThickness: "auto",
textUnderlineOffset: "auto",
textDecorationSkipInk: "auto",
}camelCased keys for a style prop in React, Preact, or Solid.
Tailwind classes
underline decoration-solid decoration-[#2563eb] decoration-auto underline-offset-auto
Built-in utilities are used where they exist (underline, decoration-wavy, decoration-2, underline-offset-4). Custom colors and odd pixel values fall back to arbitrary values like decoration-[#2563eb] or underline-offset-[6px]. Skip-ink other than auto requires the [text-decoration-skip-ink:none] arbitrary property.
How to use
- Pick a preset to start from a known good look, or leave the defaults and tune from there.
- Choose the line (underline, overline, line-through, or both) and the style (solid, double, dotted, dashed, or wavy).
- Set the color with the swatch or hex field, then pick a thickness (auto, from the font, or a custom pixel value) and an underline offset (auto or pixel).
- Pick a skip-ink mode if you want the line to draw through descenders. Set the preview text, font, size, weight, color, and background to see the result in context.
- Copy the CSS rule block, the text-decoration shorthand, the React style object, or the Tailwind class chain from the output panels on the right.
About this tool
CSS Underline Generator builds the modern CSS text-decoration declaration from a small set of editable controls and renders the live preview using the exact value the tool will copy. The generator covers every property from CSS Text Decoration Module Level 4: text-decoration-line (underline, overline, line-through, or both lines at once), text-decoration-style (solid, double, dotted, dashed, or wavy), text-decoration-color as any hex value, text-decoration-thickness (auto, from-font, or a custom pixel value from 1 to 16), text-underline-offset (auto or a custom pixel value from 0 to 24), and text-decoration-skip-ink (auto, none, or all) which controls whether the underline cuts through the descenders of letters like g, j, p, q, and y. Nine presets cover the everyday cases: a classic blue link, a thick offset emphasis line, a red wavy spell-check style, a soft dotted footnote, a dashed annotation, a double editorial score, a strikethrough for prices, a heavy highlighter marker, and a neon overline for dark UI. The live preview lets you choose the text content, pick a sans, serif, mono, or display font stack, set the size from 16 to 96 pixels, choose a weight from 300 to 800, set the text color, and switch the background between light, dark, and a checker so you can confirm the line reads in the contexts you actually ship. Four copy-ready outputs are produced. The CSS rule block targets a customisable selector (default .underlined) and pairs the text-decoration shorthand with the thickness, offset, and skip-ink longhands that the shorthand cannot express. The shorthand value is also available on its own for cases where you want to drop it inline. The React style object uses camelCased keys (textDecoration, textDecorationThickness, textUnderlineOffset, textDecorationSkipInk) so it pastes directly into a style prop. The Tailwind class chain uses first-class utilities where they exist (underline, overline, line-through, decoration-wavy, decoration-double, decoration-from-font, decoration-2, decoration-4, decoration-8, underline-offset-4) and falls back to arbitrary values (decoration-[#2563eb], underline-offset-[6px], [text-decoration-skip-ink:none]) for custom colors, off-scale pixel values, and skip-ink modes Tailwind does not ship a utility for. Useful for styling links the brand wants to feel distinctive, highlighting prices with a clean strikethrough, marking errors with a wavy red line, drawing attention with a thick offset accent under a heading, or anywhere the default browser underline does not match the design. Everything runs in your browser; nothing is uploaded.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
CSS Text Shadow Generator
Visual editor for stacked CSS text-shadow with neon, retro, and outline presets.
Open tool
GeneratorCSS Text Gradient Generator
Live gradient text with linear, radial, and conic gradients, custom stops, presets, CSS and Tailwind output.
Open tool
GeneratorCSS Line Clamp Generator
Live multi-line ellipsis builder with CSS, Tailwind, JSX, and HTML output.
Open tool
GeneratorCSS Line-Height Generator
Visual line-height picker with live preview, presets, measure check, and CSS or Tailwind output.
Open tool
DeveloperTailwind to CSS Converter
Convert Tailwind utility classes to plain CSS rules with a per-class breakdown.
Open tool
GeneratorFluid Type Scale Generator
Build a Utopia-style fluid type ramp with clamp(), live preview, and copy-ready tokens.
Open tool