css中display为none 和visibility为hidden的区别
display:none
Turns off the display of an element (it has no effect on layout);
all child elements also have their display turned off.
//隐藏这个元素;所有的子元素也跟着他隐藏.
visibility:hidden
The box is invisible (fully transparent, nothing is drawn), but still affects layout.
Descendants of the element will be visible
if
they have visibility:visible
(
this
doesn‘t work
in
IE up to version 7).
//这个容器不可见(完全透明),但占有布局.后代(子)元素将会显示,如果设有visible属性
visibility为hidden时,仍然占用页面流,也就是这块区域虽然不可见,但是占据一块空间.
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。