请查看下面的HTML,其中我已经使用了jQuery UI datepicker,并尝试使用CSS3 PIE在Internet Explorer< = 8中为它提供圆角。该框显示圆角但不显示日期选择器。我还按照文档中的建议应用了position: relative; z-index: 0
。
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>jQuery UI Example Page</title>
<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/base/jquery-ui.css" rel="stylesheet" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js"></script>
<script type="text/javascript">
$(function () {
$('#datepicker').datepicker({
inline: true
});
});
</script>
<style type="text/css">
.roundedCorners {
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
behavior: url(PIE.htc);
position: relative;
z-index: 0;
}
</style>
</head>
<body>
<div class="roundedCorners" style="width: 100px; height: 100px; background-color: Blue"> </div>
<br />
<div id="datepicker" class="roundedCorners"></div>
</body>
</html>
答案 0 :(得分:0)
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>jQuery UI Example Page</title>
<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/base/jquery-ui.css" rel="stylesheet" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js"></script>
<script type="text/javascript">
$(function () {
$('#datepicker').datepicker({
inline: true
});
});
</script>
<style type="text/css">
.roundedCorners {
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
behavior: url(PIE.htc);
position: relative;
z-index: 0;
}
.ui-datepicker{
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
behavior: url(PIE.htc);
position: relative;
z-index: 0;}
</style>
</head>
<body>
<div class="roundedCorners" style="width: 100px; height: 100px; background-color: Blue"> </div>
<br />
<div id="datepicker" class="roundedCorners"></div>
</body>
</html>
你必须在特定的UI类中添加圆角!
我对您的示例所做的修改适用于FFX,Opera,IE8和IE8兼容性视图。它只会显示带有圆角的外盒。
这是一个修改,使得datepicer在IE8,FFX 3.1.5和Opera 10中看起来完全相同
.ui-datepicker-inline div{
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
behavior: url(PIE.htc);
position: relative;
z-index: 0;}
.ui-datepicker-inline{
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
behavior: url(PIE.htc);
position: relative;
z-index: 0;}