Edit this page

up.element [hidden]
HTML selector

This feature is experimental. It may be changed or removed in a future version.

Elements with this attribute are hidden from the page.

While [hidden] is a standard HTML attribute its default implementation is not very useful. In particular it cannot hide elements with any display rule. Unpoly improves the default CSS styles of [hidden] so it can hide arbitrary elements.

Customizing the CSS

Unpoly's default styles for [hidden] look like this:

[hidden][hidden] {
  display: none !important;
}

You can override the CSS to hide an element in a different way, e.g. by giving it a zero height:

.my-element[hidden] {
  display: block !important;
  height: 0 !important;
}

Important

Any overriding selector must have a specificity of (0, 2, 0). Also all rules should be defined with !important to override other styles defined on that element.