Chinaz.com - 中国站长站

匿名投稿 投稿指南 RSS订阅 站长资讯通告:
搜索: 您的位置主页>设计在线>WEB标准>阅读资讯:最常用的12种CSS BUG解决方法与技巧

最常用的12种CSS BUG解决方法与技巧

2008-08-05 10:37:28 来源:52css 作者:编辑整理 【 评论:2

十一、 最小宽度

  

IE6另外一个bug就是它不支持 min-width 属性. min-width又是相当有用的, 特别是对于弹性模板来说, 它们有一个100%的宽度,min-width 可以告诉浏览器何时就不要再压缩宽度了。
除IE6以外所有的浏览器你只需要一个 min-width: Xpx; 例如:


.container { 
min-width:300px; 
}

为了让他在IE6下工作, 我们需要一些额外的工作. 开始的时候我们需要创建两个div, 一个包含另一个:


<div class="container"> 
<div class="holder">Content</div> 
</div>

然后你需要定义外层div的min-width属性


 .container { 
min-width:300px; 
}

这时该是IE hack大显身手的时候了. 你需要包含如下的代码:


* html .container { 
border-right: 300px solid #FFF; 

* html .holder { 
display: inline-block; 
position: relative; 
margin-right: -300px; 
}

As the browser window is resized the outer div width reduces to suit until it shrinks to the border width, at which point it will not shrink any further. The holder div follows suit and also stops shrinking. The outer div border width becomes the minimum width of the inner div.

十二、隐藏水平滚动条

为了避免出现水平滚动条, 在body里加入 overflow-x:hidden 。

当你决定使用一个比浏览器窗口大的图片或者flash时, 这个技巧将非常有用。

 

本文转载自52CSS,原文地址:http://www.52css.com/article.asp?id=809

Tags:CSS   BUG   解决方法  
责任编辑:水色皇朝
  • 请文明参与讨论,禁止漫骂攻击。 用户名:新注册) 密码: 匿名:
    评论总数: [ 查看全部 ] 网友评论
    关于我们 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 人才招聘 - 帮助