Css IE8在以下方面做得很奇怪:之前和背景
IE8在以下方面做得很奇怪:之前和背景 我用:before和background来模拟一个无线电输入,代码如下Css IE8在以下方面做得很奇怪:之前和背景,css,internet-explorer-8,background,Css,Internet Explorer 8,Background,IE8在以下方面做得很奇怪:之前和背景 我用:before和background来模拟一个无线电输入,代码如下 <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <!-- Set the viewport width to device width for mobile --> <meta name="viewport" content="width=dev
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<!-- Set the viewport width to device width for mobile -->
<meta name="viewport" content="width=device-width" />
<title>Welcome to Foundation</title>
<script src="javascripts/modernizr.foundation.js"></script>
<link rel="stylesheet" href="stylesheets/docs.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"> </script>
<style>
#aaa:before {
width:16px;
height:16px;
content:"";
display:block;
background: transparent url('img/7.png') -2px -2px no-repeat;
}
#aaa.checked:before {
background-position: -38px -2px;
}
</style>
</head>
<body>
<div id="aaa" onclick='$("#aaa").toggleClass("checked")'></div>
</body>
</html>
欢迎来到基金会
#aaa:以前{
宽度:16px;
高度:16px;
内容:“;
显示:块;
背景:透明url('img/7.png')-2px-2px不重复;
}
#aaa.检查:之前{
背景位置:-38px-2px;
}
在chrome上,点击图像,效果很好,在IE8上,第一次点击图像没有效果,第二次,效果很奇怪 您是否处于兼容模式?否,F12显示它处于IE8标准模式,在IE10上以IE8标准模式运行时没有问题。