search results:

    • Standard
    • React
    License Free hosting Learn Services Community
    • + D
    • Light
    • Dark
    • System
    logo Tailwind Elements
    • Getting started
      • Quick start
      • Tutorials
      • Design system
      • Local installation
      • Optimization
      • Dark mode
      • Theming
      • Changelog
      • Contribute
      • Internationalization guide
    • Integrations
      • Angular
      • Django
      • Express
      • Laravel
      • Next
      • Nuxt
      • React
      • Remix
      • Solid
      • Svelte
      • Vue
    • Content & styles
      • Animations
      • Animations Extended
      • Colors
      • Dividers
      • Figures
      • Headings
      • Hover effects
      • Icons
      • Images
      • Mask
      • Shadows
      • Typography
    • Navigation
      • Breadcrumbs
      • Footer
      • Headers
      • Mega menu
      • Navbar
      • Offcanvas
      • Pagination
      • Pills
      • Scrollspy
      • Sidenav
      • Tabs
    • Components
      • Accordion
      • Alerts
      • Avatar
      • Badges
      • Button group
      • Buttons
      • Cards
      • Carousel
      • Chips
      • Collapse
      • Dropdown
      • Gallery
      • Jumbotron
      • Lightbox
      • Link
      • List group
      • Modal
      • Notifications
      • Paragraphs
      • Placeholders
      • Popconfirm
      • Popover
      • Progress
      • Rating
      • Scroll back to top button
      • Social buttons
      • Spinners
      • Stepper
      • Testimonials
      • Timeline
      • Toast
      • Tooltip
      • Video
      • Video carousel
    • Forms
      • Checkbox
      • Datepicker
      • Datetimepicker
      • File input
      • Form templates
      • Input Group
      • Inputs
      • Login form
      • Radio
      • Range
      • Registration form
      • Search
      • Select
      • Switch
      • Textarea
      • Timepicker
      • Validation
    • Data
      • Charts
      • Charts advanced
      • Datatables
      • Tables
    • Methods
      • Clipboard
      • Infinite scroll
      • Lazy loading
      • Loading management
      • Ripple
      • Scrollbar
      • Smooth scroll
      • Sticky
      • Touch
    • Design Blocks
      • Banners
      • Contact
      • Content
      • CTA
      • FAQ
      • Features
      • Headers
      • Hero / Intro sections
      • Logo clouds
      • Mega menu
      • News
      • Newsletter
      • Pricing
      • Projects
      • Stats
      • Team
      • Testimonials
    • Coming Soon
      • Angular
      • Builder
      • Templates
      • Vue
    • ResourcesNew
      • Playground
      • YouTube Channel
      • Private FB Group
      • Newsletter
      • UI Design course New
      • UI / UX tips
    • Overview
    • typography

    Text decoration

    Tailwind CSS Text decoration

    Use responsive text decoration utilities with Tailwind Elements. Add flair to your text with decoration styles like underline, overline, and line-through.


    Basic example

    Use .underline, .no-underline, and .line-through utilities to control how text is decorated.

    Paragraph with underline class.

    Paragraph with overline class.

    Paragraph with line-through class.

    Paragraph with no-underline class.

    • HTML
            
                
            <p class="underline">This text will be underlined.</p>
            
            
        

    Color of the underline

    By default, the underline will be the same color as the text. But you can customize the color of the underline using the .decoration-{color} utility.

    This text will be underlined in red.

    This text will be underlined in green.

    • HTML
            
                
            <p class="underline decoration-red-500">
              This text will be underlined in red.
            </p>
            <p class="underline decoration-green-500">
              This text will be underlined in green.
            </p>
            
            
        

    Underline on hover

    You can also use the .hover:underline class to apply the underline only when the element is hovered over.

    This text will be underlined only when hovered over.

    • HTML
            
                
            <p class="hover:underline">
              This text will be underlined only when hovered over.
            </p>
            
            
        

    Underline offset

    For controlling the offset of the underline, you can use the .underline-offset-{number} utility class.

    This text will have an underline offset of 2px.

    This text will have an underline offset of 4px.

    This text will have an underline offset of 8px.

    • HTML
            
                
            <p class="underline underline-offset-2">
              This text will have an underline offset of 2px.
            </p>
            <p class="underline underline-offset-4">
              This text will have an underline offset of 4px.
            </p>
            <p class="underline underline-offset-8">
              This text will have an underline offset of 8px.
            </p>
            
            
        

    Related resources

    Typography Textarea Input Fields Center text Center text vertically and horizontally Display flex Lettter spacing Paragraph spacing Text bold Text color Text decoration Text ellipsis Text size Text truncate Text wrap Vertically align text Text shadow Gradient text

    If you are looking for more advanced options, try typography from MDBootstrap.

    • Basic example
    • Color of the underline
    • Underline on hover
    • Underline offset
    • Related resources
    Get useful tips & free resources directly to your inbox along with exclusive subscriber-only content.
    Join our mailing list now
    © 2023 Copyright: MDBootstrap.com