﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>IT博客-笨小孩的web开发</title><link>http://www.cnitblog.com/txxg/</link><description>Impossible Is Nothing!</description><language>zh-cn</language><lastBuildDate>Tue, 05 May 2026 14:57:52 GMT</lastBuildDate><pubDate>Tue, 05 May 2026 14:57:52 GMT</pubDate><ttl>60</ttl><item><title>关于div的隐藏</title><link>http://www.cnitblog.com/txxg/archive/2006/08/23/15784.html</link><dc:creator>笨小孩</dc:creator><author>笨小孩</author><pubDate>Wed, 23 Aug 2006 05:46:00 GMT</pubDate><guid>http://www.cnitblog.com/txxg/archive/2006/08/23/15784.html</guid><wfw:comment>http://www.cnitblog.com/txxg/comments/15784.html</wfw:comment><comments>http://www.cnitblog.com/txxg/archive/2006/08/23/15784.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/txxg/comments/commentRss/15784.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/txxg/services/trackbacks/15784.html</trackback:ping><description><![CDATA[
		<p>div的visibility可以控制div的显示和隐藏，但是隐藏后页面显示空白:</p>
		<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
				<img src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align="top" />
				<span style="COLOR: #000000">style</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">visibility none;<br /><img src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align="top" />document.getElementById(typediv1).style.visibility</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">hidden;隐藏<br /><img src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align="top" />document.getElementById(typediv1).style.visibility</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">visible;显示<br /></span>
		</div>
		<p>
				<br />通过设置display属性可以使div隐藏后释放占用的页面空间:<br /></p>
		<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
				<span style="COLOR: #008080">1</span>
				<img src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align="top" />
				<span style="COLOR: #000000">style</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">display none;<br /></span>
				<span style="COLOR: #008080">2</span>
				<span style="COLOR: #000000">
						<img src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align="top" />
						<br />
				</span>
				<span style="COLOR: #008080">3</span>
				<span style="COLOR: #000000">
						<img src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align="top" />document.getElementById(typediv1).style.display</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">none;隐藏<br /></span>
				<span style="COLOR: #008080">4</span>
				<span style="COLOR: #000000">
						<img src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align="top" />
						<br />
				</span>
				<span style="COLOR: #008080">5</span>
				<span style="COLOR: #000000">
						<img src="http://www.cnitblog.com/images/OutliningIndicators/None.gif" align="top" />document.getElementById(typediv1).style.display</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">;显示</span>
		</div>
<img src ="http://www.cnitblog.com/txxg/aggbug/15784.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/txxg/" target="_blank">笨小孩</a> 2006-08-23 13:46 <a href="http://www.cnitblog.com/txxg/archive/2006/08/23/15784.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>