Skip to main content
CSS-Tricks
  • Articles
  • Alamanac
  • Guides
  • Videos
  • Books
  • Newsletter
Search

Articles Tagged
hiding

10 Articles
{
,

}
Direct link to the article Comparing Various Ways to Hide Things in CSS
accessibility hiding

Comparing Various Ways to Hide Things in CSS

You would think that hiding content with CSS is a straightforward and solved problem, but there are multiple solutions, each one being unique.

Developers most commonly use display: none to hide the content on the page. Unfortunately, this way of …

Avatar of Marko Ilic
Marko Ilic on Oct 27, 2020 (Updated on Nov 3, 2020)
Direct link to the article The `hidden` Attribute is Visibly Weak
display hidden hiding

The `hidden` Attribute is Visibly Weak

There is an HTML attribute that does exactly what you think it should do:

<div>I'm visible</div>
<div hidden>I'm hidden</div>

It even has great browser support. Is it useful? Uhm. Maybe. Not really. …

Avatar of Chris Coyier
Chris Coyier on Oct 16, 2019
Direct link to the article Inclusively Hidden
accessibility hiding inert visibility

Inclusively Hidden

Scott O’Hara recently published “Inclusively Hidden,” a nice walkthrough of the different ways to hide things on the web. Nothing is ever cut and dry when it comes to the web! What complicates this is that hidden begs the question: …

Avatar of Chris Coyier
Chris Coyier on Apr 19, 2019 (Updated on Feb 23, 2021)
Direct link to the article See No Evil: Hidden Content and Accessibility
accessibility hiding

See No Evil: Hidden Content and Accessibility

There is no one true way to hide something on the web. Nor should there be, because hiding is too vague. Are you hiding visually or temporarily (like a user menu), but the content should still be accessible? Are you …

Avatar of Chris Coyier
Chris Coyier on Mar 15, 2019
Direct link to the article Beware Smushed Off-Screen Accessible Text
accessibility hiding

Beware Smushed Off-Screen Accessible Text

J. Renée Beach:

Over a few sessions, Matt mentioned that the string of text “Show more reactions” was being smushed together and read as “Showmorereactions”.

Turns out a popular technique for hiding content visually (but not hiding it for assistive …

Avatar of Chris Coyier
Chris Coyier on Oct 14, 2016 (Updated on Oct 18, 2016)
Direct link to the article #142: Hiding Things With CSS
hiding

#142: Hiding Things With CSS

There isn’t just a single CSS property that you reach for when hiding and showing things in CSS. There are a bunch of considerations that we’ll go over in this video.

For instance, there is the display property in which …

Avatar of Chris Coyier
Chris Coyier on Oct 16, 2015 (Updated on Feb 22, 2021)
Direct link to the article Toggle Visibility When Hiding Elements
hiding visibility

Toggle Visibility When Hiding Elements

The development team at Medium have discussed some bad practices that break accessibility. In one example, they argue that opacity is not well supported by screen readers and so if we want to hide an element in a transition …

Avatar of Robin Rendle
Robin Rendle on Sep 17, 2015 (Updated on Feb 22, 2021)
Direct link to the article Places it’s tempting to use `display: none;`, but don’t
accessibility hiding

Places it’s tempting to use `display: none;`, but don’t

Help yourself be better at accessibility by using better hiding techniques that don't use display: none;. This involves some tricks like using more clever class names, being fancier with how you deal with JavaScript library animations, or avoiding hiding all together.
Avatar of Chris Coyier
Chris Coyier on Feb 27, 2012 (Updated on Sep 13, 2019)
Direct link to the article visibility
hiding visibility

visibility

The visibility property in CSS has two different functions. It hides rows and columns of a table, and it also hides an element without changing the layout.

p {
  visibility: hidden;
}
tr {
  visibility: collapse;
}

visibility has …

Avatar of Sara Cope
Sara Cope on Sep 6, 2011 (Updated on Feb 22, 2021)
Direct link to the article Accessibility/SEO Friendly CSS Hiding
accessibility hiding

Accessibility/SEO Friendly CSS Hiding

.screen-reader-text {
  position: absolute;
  top: -9999px;
  left: -9999px;
}

This class can remove an item from the page, taking it out of flow and doesn’t cause overflow scrolling.

It’s better than display: none; or even visibility: hidden; when the goal …

Avatar of Chris Coyier
Chris Coyier on Aug 21, 2009 (Updated on Jan 25, 2020)

CSS-Tricks is powered by DigitalOcean.

Keep up to date on web dev

with our hand-crafted newsletter

DigitalOcean
  • About DO
  • Cloudways hosting
  • Legal stuff
  • Get free credit!
CSS-Tricks
  • Write for us!
  • Advertise with us
  • Contact us
Social
  • RSS Feeds
  • CodePen
  • Mastodon
  • X
Back to Top