<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
* {
margin: 0;
padding: 0;
}
.content {
margin: 50px auto 0;
width: 480px;
height: 200px;
border: 10px solid #444;
padding: 5px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
-ms-border-radius: 3px;
-o-border-radius: 3px;
border-radius: 5px;
}
.content .test,
.content .txt {
float: left;
}
.content .txt {
margin: 2px 0 0 10px;
_margin-top: 4px;
}
.content p {
margin-top: 4px;
_margin-top: 2px;
height: 20px;
font: 14px "Microsoft YaHei", arial, serif;
color: #666;
}
.content p span {
color: #000;
padding: 0 5px;
}
.content .test {
width: 200px;
height: 200px;
background: #f60; /*all*/
background: #06f\9; /*IE*/
*background: #666; /*IE6,7*/
_background: #ccc; /*IE6*/
}
/* webkit and opera */
@media all and (min-width:0){
.content .test {
background: #0f0;
}
}
/* webkit */
@media screen and (-webkit-min-device-pixel-ratio:0) {
.content .test {
background: #ff0;
}
}
/*FireFox*/
@-moz-document url-prefix() {
.content .test {
background: #f0f;
}
}
/*IE9+*/
@media all and (min-width:0) {
.content .test{
background: #f00\9;
}
}
/*IE10+*/
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
.content .test {
background: #0ff;
}
}
</style>
</head>
<body>
<div class="content">
<div class="test"></div>
<div class="txt">
<p>IE6下背景颜色:<span class="ie6" style="background-color: #ccc;">#ccc</span></p>
<p>IE7下背景颜色:<span class="ie7" style="background-color: #666;">#666</span></p>
<p>IE8下背景颜色:<span class="ie8" style="background-color: #06f;">#06f</span></p>
<p>IE9下背景颜色:<span class="ie9" style="background-color: #f00;">#f00</span></p>
<p>IE10下背景颜色:<span class="ie10" style="background-color: #0ff;">#0ff</span></p>
<p>webkit,Safari,Chrome下背景颜色:<span class="webkit-safari-gg" style="background-color: #ff0;">#ff0</span></p>
<p>FireFox下背景颜色:<span class="firefox" style="background-color: #f0f;">#f0f</span></p>
<p>Opera下背景颜色:<span class="opera" style="background-color: #0f0;">#0f0</span></p>
</div>
</div>
</body>
</html>css hack 大全
原创
©著作权归作者所有:来自51CTO博客作者maobinhou的原创作品,请联系作者获取转载授权,否则将追究法律责任
上一篇:js实现拖动层
下一篇:css 垂直居中文本
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Excel常用知识大全
当谈到Excel的常用知识时,以下是一个清晰且分点表示的大全:
数据 显示方式 数据验证 -
css hack原理
css hack原理:IE6能识别下划线"_"和星号" * "IE7能识别星号" * ",但不能识别下划线"_"firefox两个都不能认识书写顺序,一般是将识别能力强的浏览器的CSS写在后面。例如: <style> iv{
浏览器 firefox css background 下划线 -
CSS Hack收集。
快查............以上内容可能并不全面,欢迎大家能和我一起把这些技巧都汇总起来,为以后工作的查询提供一个方便,同时在这里感谢那些研究出这些HACK的作者们
css html safari firefox 盒模型 -
Firefox 3 CSS Hack
galeki,posted in其他,Firefox3RC1终于横空出生,试用了一下,感触熏染不错,页面渲染速度抬举极度光显,js的实行速度也有很大年夜的抬举,cpu和内存占用率也降落
posted firefox 页面渲染 css 超链接
















