notwaldorf / ama

:raising_hand: Ask @notwaldorf anything!
94 stars 13 forks source link

How to use "hidden" attribute with "display" property #134

Open MortezaMirmojarabian opened 4 months ago

MortezaMirmojarabian commented 4 months ago

Dear Monica,

Regarding your article, if you have to use the HTML hidden attribute with the CSS display property together, this is the right way to do it:

  <style>
    div:not([hidden]) { display: flex; }
  </style>
  <div hidden>
      lol guess who's still hidden
      hint: it's this thing
  </div>