区别不同浏览器,CSS hack写法:
区别IE6与FF:
#demo{
background:orange;
*background:blue;
}
区别IE6与IE7:
#demo{
background:green !important;
background:blue;
}
区别IE7与FF:
#demo{
background:orange;
*background:green;
}
区别FF,IE7,IE6:
#demo{
background:orange;
*background:green !important;
*background:blue;
}
注:IE都能识别*;标准浏览器(如FF)不能识别*;
IE6能识别*,但不能识别 !important,
IE7能识别*,也能识别!important;
FF不能识别*,但能识别!important;
我自己是使用下划线,我最开始区别 ie6 和 FF 的时候 习惯在代码里面加 /**/如: margin-top:1px;
margin-top/**/:5px;去实现我现在改变了写法
#demo{
background:orange;
_background:green !important;
_background:blue;
}
理由和上面说的一样,FF不认_ ie认_ ie6不认识!important 根据这些区别,采用不同的Hack 手法
[教程]CSS区别不同浏览器写法
相关推荐
- C# 怎么用OpenCVSharp4实现图片表格识别
- ChatGPT 本地部署及搭建_孟郎郎的博客-CSDN博客
- Cursor 全自动代码生成器?你还没用过?接下来我就来介绍智能 AI 代码生成工具 Cursor 安装和使用 - 掘金
- 【Windows】文件夹被占用删除不掉_Energet!c的博客-CSDN博客
- docfile已损坏 docfile has been corrupted visual studio 2022
- Lodop谷歌浏览器无法打印,解决谷歌浏览器最新chrome94版本CORS跨域问题 - 知乎
- Aspnet Mvc 前后端分离项目手记(二)关于token认证 - 小小爵 - 博客园
- 尝试打开或创建物理文件时,CREATE FILE遇到操作系统错误5 (拒绝访问_麻木博客-CSDN博客