站长之家

站长资讯通告:
您的位置: 首页 » 设计 » 教程 » 正文

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

[ ] 来源: 52css 评论: 0 分享至:

百度权重查询 站长交易 友情链接交换 网站建设,网站设计,企业建站就找313

十一、 最小宽度

  

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

上一页 1 2 3 4 5 6 7
分享至:
Tags:CSS BUG 解决方法
最新图文资讯
1 2 3 4 5 6
理智评论文明上网,拒绝恶意谩骂 用户名:
网友评论
站长之家专栏推荐
商讯
最新视频
论坛推荐帖子
评测
关于站长之家 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 人才招聘 - 帮助