style="visibility:hidden": 对象在网页上所占的空间没有改变.
style="display:none": 不为对象保留物理空间.
例子:
<html>
<head>
<title>style="visibility:hidden"与style="display:none"的区别</title>
</head>
<body>
<span style="visibility:hidden">隐藏区域</span><span style="显示区域</span>
<span style="display:none">隐藏区域</span><span style="background-color:Green">显示区域</span><br/>
</body>
</html>
时间: 2024-11-04 06:13:59