CSS !important语法
!important语法针对的是“后面的属性覆盖前面的属性”这一语法,也就是说标识了!important的属性,是不被后面的相同属性所覆盖的,而IE6不认识这个,导致其他浏览器很容易根据这点“欺负”IE6:
div{
text-decoration:overline;
*text-decoration:line-through!important;
*text-decoration:underline;
}
原理:
1.FF不认识*,但IE6/IE7认识
2.IE6不认识!imprtant,但IE7认识
注意,顺序不能换,如果改为下面这样:
text-decoration:overline;
*text-decoration:underline;
*text-decoration:line-through !important;
IE6和IE7都一样了。
上网查了一下,IE6是支持!important属性的(该属性为CSS1语法,支持IE4+),上面的写法只是IE6的一个bug(同一个{}里面,相同属性取后者),若想要IE6支持,一般的做法是将CSS拆分,比如:
div{
text-decoration:line-through!important;
}
div{
text-decoration:underline;
}
这样,在IE6下,显示的是line-through效果。
如" hp laptop battery
"
相关文档:
The CSS Anthology 101 Essential Tips Tricks Hacks 3rd Edition
The Ultimate CSS Reference
Teach Yourself Visually Html And CSS
Everything You Know About CSS is Wrong
The CSS Anthology 101 Essential T ......
原样式:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>52css.com</titl ......
减少网站HTTP请求这是加快网站访问速度的关键,而CSS sprites技术是把多张图像组合成一张图像,这样用户在访问网站时一次性把多张图片加载完,而不需要一张张图片的加载,这样减少了组件的页码,建立更丰富的内容的网站,同时也取得了快速的反应
时间。
&n ......
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JS+CSS相册展示&l ......