css
css 知识点 -凯发ag旗舰厅登录网址下载
css 一些琐碎知识点记录下
1:标签a 的样式添加顺序:
a:link {color:#006600; font-size:30px;} /* 未访问的链接 green */
a:visited { color:#ff0000; font-size:30px; text-decoration: underline;} /* 已访问的链接 红*/
a:hover { color:#000000; font-size:30px; text-decoration: underline;} /* 当有鼠标悬停在链接上*/
a:active { color:#000066; font-size:30px; text-decoration: none;} /* 被选择的链接blue */
使用的时候必须按照以上的顺序写,不然效果可能体现不了
在 css 定义中,a:hover 必须位于 a:link 和 a:visited 之后!! a:active 必须位于 a:hover 之后!!
2:css浏览器兼容:
a: !important (功能有限):
随着ie7对!important的支持, !important 方法现在只针对ie6的兼容.(注意写法.记得该声明位置需要提前.)
例如:
#example {
width: 100px !important; /* ie7 ff */
width: 103px; /* ie6 */
}
b: css hack的方法:
所有浏览器 通用 height: 100px;
ie6 专用 _height: 100px;
ie7 专用 * height: 100px;
ie6、ie7 共用 *height: 100px;
ie7、ff 共用 height: 100px !important;
ie9 height:100px\9;
需要注意的是,代码的顺序一定不能颠倒了../*ff*/ /*ie9*/ /*ie8*/ /*ie7*/ /*ie6*/
* html 对ie7的兼容 必须保证html顶部有如下声明:
总结
- 上一篇: 吕蒙的故事文言文翻译(吕蒙的故事)
- 下一篇: 眰恦(说一说眰恦的简介)