您现在的位置是:首页 > cms教程 > ecshop商城教程ecshop商城教程
ecshop兼容CSS样式在FF、IE7、IE6中的不同表现
含蕾2023-12-21 21:47:54ecshop商城教程已有9人查阅
导读随着IE7对!important的支持,现在IE7和FF都支持!important,可以用!important来区分FF、IE7和IE6的高度。
1. !important
随着IE7对!important的支持,现在IE7和FF都支持!important,可以用!important来区分FF、IE7和IE6的高度。
用法如下: 2.IE6/IE7对FireFox
*+html 与 *html 是IE特有的标签, firefox 暂不支持.而*+html 又为 IE7特有标签,IE6暂不支持。
用法如下:
<style rel="stylesheet" type="text/css"> <!-- .content{background:#a5a5a5;height:100px;} *html .content{background:#a5a5a5;height:200px;} *+html .content{background:#a5a5a5;height:300px;} --> </style>
height:50px; *height:100px; _height:150px;
同样可以用相同的原理来为IE6、IE7、FF设置不同的width,height,margin,padding等属 。
3.min-height
IE不认min-height,FF识别,利用以上这些属 ,我们可以这样定义很小高度
<style rel="stylesheet" type="text/css"> <!-- .content{background:#a5a5a5;height:auto!important; height:500px; min-height:500px;} --> </style>
我是这样理解这段代码的:
因为在IE里(包括IE6,IE7)认为height就是很小高度,当content中的内容超出设置的高度时,在FF中可以用min-height设置很小高度××,这时即使超出content的高度,背景颜 也会自动延伸下去。但IE不识别min-height,所以要加hack(对程序所作的修改,在尚未被开发者接受并集成到正式版本中之前被称为hack)。
4.区别不同浏览器,Css hack写法:
区别IE6与FF:
background:orange;*background:blue;
区别IE6与IE7:
background:green !important;background:blue;
区别IE7与FF:
background:orange;*background:green;
区别FF,IE7,IE6:
background:orange;*background:green !important; *background:blue;
随着IE7对!important的支持,现在IE7和FF都支持!important,可以用!important来区分FF、IE7和IE6的高度。
用法如下: 2.IE6/IE7对FireFox
*+html 与 *html 是IE特有的标签, firefox 暂不支持.而*+html 又为 IE7特有标签,IE6暂不支持。
用法如下:
<style rel="stylesheet" type="text/css"> <!-- .content{background:#a5a5a5;height:100px;} *html .content{background:#a5a5a5;height:200px;} *+html .content{background:#a5a5a5;height:300px;} --> </style>
height:50px; *height:100px; _height:150px;
同样可以用相同的原理来为IE6、IE7、FF设置不同的width,height,margin,padding等属 。
3.min-height
IE不认min-height,FF识别,利用以上这些属 ,我们可以这样定义很小高度
<style rel="stylesheet" type="text/css"> <!-- .content{background:#a5a5a5;height:auto!important; height:500px; min-height:500px;} --> </style>
我是这样理解这段代码的:
因为在IE里(包括IE6,IE7)认为height就是很小高度,当content中的内容超出设置的高度时,在FF中可以用min-height设置很小高度××,这时即使超出content的高度,背景颜 也会自动延伸下去。但IE不识别min-height,所以要加hack(对程序所作的修改,在尚未被开发者接受并集成到正式版本中之前被称为hack)。
4.区别不同浏览器,Css hack写法:
区别IE6与FF:
background:orange;*background:blue;
区别IE6与IE7:
background:green !important;background:blue;
区别IE7与FF:
background:orange;*background:green;
区别FF,IE7,IE6:
background:orange;*background:green !important; *background:blue;
本文标签:
很赞哦! (1)
上一篇:整理简单的统一CSS命名规则
下一篇:ecshop数据库订单状态判断
暂无内容 |
暂无内容 |
相关文章
暂无内容 |
暂无内容 |
随机图文
ecshop订单总价币种汇率转换介绍
ecshop订单总价价格汇率结算,后台设置币种转换汇率,在购物车结算页面显示订单应付总价和显示汇率转换后的总价,付款按汇率转换后实际付款币种付款,支持pc端和手机端。ecshop商品与文章删除时同时删除商品图片
ECSHOP删除文章或从回收站删除商品,文章内容和商品描述中的图片(位于/images/upload/Image目录)无法删除,时间长了会占用相当大的空间ecshop热门搜索关键词随机显示的实现方法
实现ECSHOP热门搜索关键词随机显示,需要修改ECSHOP模板和ECShOP程序,按照步骤修改即可。一、打开 include/lib_main.php 文件,找到下面这段代码,删除之(大概在1652行左右)Linux下搭建ecshop的步骤方法
打开虚拟机,选择自己的虚拟机,右键设置检查下列勾选框是否勾选上创建文件夹mkdir /mnt/cdrom加载LINUX安装光盘mount /dev/cdrom /mnt/cdrom进入安装程序目录cd /mnt/cdro
留言与评论 (共有 0 条评论) |