`

解决IE6下div table 使用display:none;隐藏时仍然占空白位置

阅读更多

在所有要隐藏的div元素后面增加:

<span style='clear:both;'/>

 

可解决IE6 的 display:none; bug

 

<div>
这里是要隐藏的div,通过jquery.hide()方式隐藏它,ie6下仍会在物理上占用空间,后面的对象无法上移;可在各该div对象的后面增加<span style='clear:both;'/> 解决浏览器的不兼容bug
</div>
<span  style='clear:both;'/>

 

0
0
分享到:
评论

相关推荐

    css 清除浏览器默认样式

    content:none}:focus{outline:0}ins{text-decoration:none}del{text-decoration:line-through}table{border-collapse:collapse;border-spacing:0}a img {border:none;} /* container,clearfix */ .container:after, ...

    HTML 网页设计

    display:table; } .group:after { clear:both; } .group { zoom:1; } .grid { display: block; float:none; margin: 0% 0 0% 0%; } .grid:first-child { margin-left: 0; } .images_3_of_1 { width:100%; ...

    XHTML语言默认的CSS样式

    html,address,blockquote,body,dd,div,dl,dt,fieldset,form,frame,frameset,h1,h2,h3,h4,h5,h6,noframes,ol,p,ul,center,dir,hr,menu,pre { display:block} li { display:list-item} head { display:none} table { ...

    三星9305收索

    top:3px}#shouji{margin-right:14px}#u{display:none}#c-tips-container{display:none}.bdsug{position:absolute;width:418px;background:#fff;display:none;border:1px solid #817f82}.bdsug li{width:402px;color:...

    静态网业模板1

    _top:6px; right:2px; z-index:250; } img.thumb{ padding:10px 0 0 0; } .new_products{ clear:both; padding:0px; } ul.list{ clear:both; padding:10px 0 0 20px; margin:0px; } ul.list li{ list-style:none; ...

    JavaScript Table行定位效果

    接着想到的是给table插入一个新tr,克隆原来的tr,并设置这个tr为fixed(ie6为absolute),例如: Code &lt;!DOCTYPE ...

    div+css实现两列table效果示例

    display:inline}.mycode ul{ width:500px; height:300px } .mycode li{ width:200px; float:left; height:30px; list-style:none} .mycode li p{text-align:right; margin-top:0px} &lt;p&gt; .sheng{ color:#F05D

    用div和ul标签画表格进行布局兼容火狐、ie6、ie7、Opera等浏览器

    复制代码代码如下:&lt;... &lt;head&gt; &lt;style&gt; &lt;!– #table { width:701px!important; width:700px; border-top:1px #000 solid; } #table ul { margin:0px;... list-style-type:none;... display

    雅虎TAB效果代码 Javascript实现

    --[if lte IE 6]&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/a&gt;&lt;![endif]--&gt; &lt;li&gt;&lt;a href="#nogo" class="four outer"&gt;SEARCH&lt;!--[if IE 7]&gt;&lt;!--&gt;&lt;/a&gt;&lt;!--&lt;![endif]--&gt; &lt;!--[if lte IE 6]&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;![endif]--&gt; &lt;div class=...

    右悬浮代码

    天猫淘宝通用详情页悬浮代码&lt;div class="J_TWidget jtfd9_6 tm-mcBodyMask " style="z-index:1;width:137px;height:auto;bottom:20px;margin-left:1040px;_display:none;opacity:1;visibility:visible;left:auto;top...

    好看的下拉菜单

    --[if lte IE 6]&gt; .menu ul li a.hide, .menu ul li a:visited.hide {display:none;} .menu ul li a:hover ul li a.hide {display:none;} .menu ul li a:hover {color:#fff; background:#36f;} .menu ul li a:hover...

    HTML5和CSS3价格表翻转切换动画特效.zip

    table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed,  figure, figcaption, footer, header, hgroup,  menu, nav, output, ruby, section, summary, time, mark, ...

    带缓冲效果的仿QQ面板折叠菜单代码

    if (Obj_Display == 'none'){ Start(ObjectId,'Opens'); $G(parentId)[removed] = "&lt;a &gt;-&lt;/a&gt;" }else{ Start(ObjectId,'Close'); $G(parentId)[removed] = "&lt;a &gt;+&lt;/a&gt;" } } function Start(ObjId,method){ ...

    一个简单的网页设计

    &lt;div class="table" id="con_one_2" style="display:none"&gt; &lt;/div&gt; &lt;div class="table" id="con_one_3" style="display:none"&gt; &lt;div&gt; &lt;p&gt;&lt;iframe src="uploadfile" frameborder="0" style="width:800px; ...

    css入门笔记

    2.hidden 隐藏的,溢出的内容全部隐藏,不可见溢出 3.scroll 显示滚动条,溢出时可用 4.auto 自动,溢出时自动显示滚动条并且可用 ============================== 9.29 1、边框线 属性:border: 取值: 2、...

    jQuery折叠菜单

    &lt;ul id="option2" class="option" style="display:none;"&gt; &lt;li class="item2"&gt;&lt;a href="#" class="title" onclick="fold(this);return false;"&gt;分类统计.gif" border="0" /&gt;分类统计 ...

    CSS 实现未知内容高度的垂直水平居中(改良版)

    垂直居中在IE浏览器下的实现比较难实现,而更难实现的应该是未知内容高度的垂直水平居中!还好网上也有很多高人发布了一些解决的方法!这里我进行了一些改良,兼容FF,IE6,IE7,Opera…如发现问题有劳回复评论! ...

    jeasyui的dataGrid的打印和导出,jeasyui报表 table转成excel 实例下载

    var tableString = '&lt;div&gt;&lt;table width="100%"&gt;&lt;tr style="text-align:center;"&gt;&lt;td colspan="2" style="font-size:24px; font-weight:bold;"&gt;&lt;span style="text-decoration:underline;"&gt; 年...

    eclipse-testng 离线包下载

    (getCurrentStyle(displayElement, "display") == "none") { displayElement.style["display"] = "block"; } else { displayElement.style["display"] = "none"; } } function toggleDetailsVisibility...

    点击文本框中按钮弹出日期

    &lt;table border="0" cellpadding="0" cellspacing="1" class="Calendar" id="caltable" style="display:none"&gt; &lt;thead&gt; &lt;tr align="center" valign="middle"&gt; &lt;td colspan="7" class="Title"&gt; ...

Global site tag (gtag.js) - Google Analytics