可见性
使用可见性工具类来控制 HTML 元素的可见性,并且不会修改 `display` 的设置。
使用 Bootstrap 内置的可见性工具类可以设置 HTML 元素的 visibility
(可见性)。这些工具类并不修改 display
的值,也不会对布局产生影响,设置了 .invisible
的 HTML 元素仍然占据页面空间。elements still take up space in the page. Content will be hidden both visually and for assistive technology/screen reader users.
根据需要使用 .visible
或 .invisible
。
<div class="visible">...</div>
<div class="invisible">...</div>
// Class
.visible {
visibility: visible !important;
}
.invisible {
visibility: hidden !important;
}
// Usage as a mixin
// Warning: The `invisible()` mixin has been deprecated as of v4.3.0. It will be removed entirely in v5.
.element {
@include invisible(visible);
}
.element {
@include invisible(hidden);
}