You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
visibility: hidden: Hides an element, but the space it occupies is preserved. (least favorable)
display: none: Hides an element and removes it from the layout, no space is reserved. (document.querySelector will fail)
hidden attribute: Similar to display: none, hides an element without space reservation, mainly used in HTML5 for toggling visibility. (complete removal from rendered UI, but not from DOM)
Gotcha about hidden. Need to add [hidden] { display: none; } in CSS for "toggle" code to work
The text was updated successfully, but these errors were encountered:
document.querySelector
will fail)Gotcha about
hidden
. Need to add[hidden] { display: none; }
in CSS for "toggle" code to workThe text was updated successfully, but these errors were encountered: