CSS hack:区分IE6,IE7,firefox
区别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;
注:IE都能识别*;标准浏览器(如FF)不能识别*;
IE6能识别*,但不能识别 !important,
IE7能识别*,也能识别!important;
FF不能识别*,但能识别!important;
IE6
IE7
FF
*
√
√
×
!important
×
√
√
IE6
IE7
FF
*
√
√
×
!important
×
√
√
IE6
IE7
FF
*
√
√
×
!important
×
√
√
IE6
IE7
FF
*
√
√
×
!important
×
√
√
另外再补充一个,下划线"_",
IE6支持下划线,IE7和firefox均不支持下划线。(推荐)
于是大家还可以这样来区分IE6,IE7,firefox
: background:orange;*background:green;_background:blue;
注:不管是什么方法,书写的顺序都是firefox的写在前面,IE7的写在中间,IE6的写在最后面。
相关文档:
/*
*创建人:蔺宜忠
*用途:学习css,应用于新闻系统
*/
*
{
/*把默认值设置为0*/
margin: 0;
padding: 0;
border-width: 0;
}
body
{
font-size: 14px;
}
a:link,a:visited
{
/*鼠 ......
IE 浏览器中 CSS 特性的最大的问题:会反复执行,每秒钟可能执行了成百上千次,有严重的性能问题。
如何对 CSS 进行优化呢?
至少:如果我们将 CSS 在匹配的元素中仅执行一次,性能将会提升很大。
&nb ......
制作过网页的人都有为画线而烦恼的经历,本文介绍的小技巧也许对你有所帮助。我们先来认识一下“Border”(画边框),它是CSS的一个属性,用它可以给能确定范围的HTML标记(如TD、DIV等等)画边框,它可以定义边框线的类型、宽度和颜色,利用这个特性,可以制作一些特殊效果。下面将通过实例来说明其应用技巧。 ......
在用DIV+CSS排版时,经常要使左右两边栏目自动等高。这里介绍个简单方法~~
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<m ......