【前端】21、什么是 Css Hack?ie6,7,8 的 hack 分别是什么?

释放双眼,带上耳机,听听看~!

什么是 Css Hack?ie6,7,8 的 hack 分别是什么?

答案:针对不同的浏览器写不同的 CSS         code 的过程,就是 CSS       hack。

 

示例如下:

 

1	#test	{			
2  width:300px;			
3  height:300px;			
4  background-color:blue;	/*firefox*/		
5  background-color:red9;	/*all ie*/		
6  background-color:yellow;	/*ie8*/		
7  +background-color:pink;	/*ie7*/		
8  _background-color:orange;	/*ie6*/	}	
9  :root #test { background-color:purple9; }	/*ie9*/	
10  @media all and (min-width:0px){ #test {background-color:black;} }	/*opera*/

11	@media screen and (-webkit-min-device-pixel-ratio:0){ #test {background-color:gray;

12	and safari*/
内容投诉
前端面试

【前端】20、超链接访问过后 hover 样式就不出现的问题是什么?如何解决?

2020-6-29 18:50:30

前端面试

【前端】22、行内元素和块级元素的具体区别是什么?行内元素的 padding 和 margin 可设置吗?

2020-9-8 15:38:40

搜索