常用的CSS hack方式
(1)方式一 条件注释法只在IE下生效<!--[if IE]>这段文字只在IE浏览器显示<![endif]-->(2)方式二 类内属性前缀法属性前缀法是在CSS样式属性名前加上一些只有特定浏览器才能识别的hack前缀,以达到预期的页面展现效果。
- “-″减号是IE6专有的hack
- “\9″ IE6/IE7/IE8/IE9/IE10都生效
- “\0″ IE8/IE9/IE10都生效,是IE8/9/10的hack
- “\9\0″ 只对IE9/IE10生效,是IE9/10的hack
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style> *> p{ color: pink; //chrome } :root p{ color:yellow\9;//IE9 } p{ color:blue\0;//IE8 } P{ *color:red; //IE7 } p{ _color:green; //IE6 } </style> </head> <body> <p>hello,everyone!i am turboemily,great to greet you!</p> </body></html>
334



被折叠的 条评论
为什么被折叠?



