Visually Hidden · Bootstrap V5.0

Skip to main content Skip to docs navigation There's a newer version of Bootstrap! Bootstrap v5.0
  • v5 releases
  • Latest (5.2.x)
  • v5.1.3
  • v5.0.2
  • v4.6.x
  • v3.4.1
  • v2.3.2
  • All versions
Expand Collapse
  • Getting started
    • Introduction
    • Download
    • Contents
    • Browsers & devices
    • JavaScript
    • Build tools
    • Webpack
    • Parcel
    • Accessibility
    • RFS
    • RTL
  • Customize
    • Overview
    • Sass
    • Options
    • Color
    • Components
    • CSS variables
    • Optimize
  • Layout
    • Breakpoints
    • Containers
    • Grid
    • Columns
    • Gutters
    • Utilities
    • Z-index
  • Content
    • Reboot
    • Typography
    • Images
    • Tables
    • Figures
  • Forms
    • Overview
    • Form control
    • Select
    • Checks & radios
    • Range
    • Input group
    • Floating labels
    • Layout
    • Validation
  • Components
    • Accordion
    • Alerts
    • Badge
    • Breadcrumb
    • Buttons
    • Button group
    • Card
    • Carousel
    • Close button
    • Collapse
    • Dropdowns
    • List group
    • Modal
    • Navs & tabs
    • Navbar
    • Offcanvas
    • Pagination
    • Popovers
    • Progress
    • Scrollspy
    • Spinners
    • Toasts
    • Tooltips
  • Helpers
    • Clearfix
    • Colored links
    • Ratio
    • Position
    • Visually hidden
    • Stretched link
    • Text truncation
  • Utilities
    • API
    • Background
    • Borders
    • Colors
    • Display
    • Flex
    • Float
    • Interactions
    • Overflow
    • Position
    • Shadows
    • Sizing
    • Spacing
    • Text
    • Vertical align
    • Visibility
  • Extend
    • Approach
    • Icons
  • About
    • Overview
    • Team
    • Brand
    • License
    • Translations
  • Migration
View on GitHub Visually hidden

Use these helpers to visually hide elements but keep them accessible to assistive technologies.

Visually hide an element while still allowing it to be exposed to assistive technologies (such as screen readers) with .visually-hidden. Use .visually-hidden-focusable to visually hide an element by default, but to display it when it’s focused (e.g. by a keyboard-only user). .visually-hidden-focusable can also be applied to a container–thanks to :focus-within, the container will be displayed when any child element of the container receives focus.

Title for screen readers

Skip to main content A container with a focusable element. <h2 class="visually-hidden">Title for screen readers</h2> <a class="visually-hidden-focusable" href="#content">Skip to main content</a> <div class="visually-hidden-focusable">A container with a <a href="#">focusable element</a>.</div>

Both visually-hidden and visually-hidden-focusable can also be used as mixins.

// Usage as a mixin .visually-hidden-title { @include visually-hidden; } .skip-navigation { @include visually-hidden-focusable; }

Tag » Col-sm-hidden Bootstrap 5