DEV Community

Discussion on: Is this element visible?

Collapse
 
ahferroin7 profile image
Austin S. Hemmelgarn

I think the answer is that we need a better definition of 'visible' versus 'hidden'.

The problem is, there's no easy definition, because:

  • Elements can have no layout box, but still be rendered (such as your display: contents example).
  • Elements can have a layout box, but not actually show anything (such as an element with opacity: 0).
  • It's technically dependent on the media type and the attributes of the element, not just the styling. An element marked as hidden using ARIA attributes is not 'visible' if a screen reader is being used for example.