Search code examples
htmlcssshow-hide

Can the hidden global attribute be changed with CSS?


If I write:

<div hidden>blah blah blah</div>

then the <div> is hidden. Can I make it visible by using just CSS? Or is there some other way to hide a <div> with just HTML that can be undone with CSS?


Solution

  • You can do it with the display property of any value different than none:

    div {
      display: block;
    }
    <div hidden>blah blah blah</div>