css hack 学习总结
<!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>CSS Hack: 区分 IE6 / IE7 /IE8 /Firefox</title>
</head>
<mce:style type="text/css" media="screen"><!--
p.ie{
height:60px;text-align:center;line-height:60px;border:1px dashed #bbb;background:#f7f7f7;font:15;
color:blue; // 所有浏览器
color:brown\9; // 所有IE浏览器
+color:red; // IE7
_color:green; // IE6
}
--></mce:style><style type="text/css" media="screen" mce_bogus="1">p.ie{
height:60px;text-align:center;line-height:60px;border:1px dashed #bbb;background:#f7f7f7;font:15;
color:blue; // 所有浏览器
color:brown\9; // 所有IE浏览器
+color:red; // IE7
_color:green; // IE6
}</style>
<body>
<p class="ie">
<span style="display:block;display:none\9;" mce_style="display:block;display:none\9;">嘿嘿,小子竟然也用Firefox,蓝色文字。</span>
<!--[if IE 8]>不错不错,挺先进的嘛,使用IE8呢!文字是褐色的。<![endif]-->
<!--[if IE 7]>你,IE7,红色文字!<![endif]-->
<!--[if IE 6]>孩子,虽然显示的是绿色文字,不过,IE6可不是好东西呢!<![endif]-->
</p>
</body>
</html>
相关文档:
这是本人学习CSS得一些心得,觉得很有用,希望对大家也有所帮助。
1. 如何写CSS友好的HTML.
大家知道要是自己的页面兼容不同厂商,不同版本的浏览器简直就是一场噩梦。一方面是因为不同浏览器的差异性,还有更重要的是我们自己写
的HTML不规范。我觉得每个HTMl标签都有它的特定的用途,有它的书写规范,我们必须遵守这些 ......
三种引用2010-03-14 17:45:36
内联定义>外链引用>内联块定义
1.内联定义
<a stype="XXX">
2 ......
一、CSS文件及样式命名
1、CSS文件命名规范
全局样式:global.css;
框架布局:layout.css;
字体样式:font.css;
链接样式:link.css;
打印样式:print.css;
2、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>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<title>www.zishu.cn</t ......
/*不管是什么方法,书写的顺序都是firefox的写在前面,IE7的写在中间,IE6的写在后面。*/
.JS_CenterAD_marquee_Right
{
margin-left:17px !important; /firefox*/
*margin-left:17px !important; / ......