1 回答

TA貢獻1802條經(jīng)驗 獲得超6個贊
這個///是改不了---的,這是谷哥自帶的功能樣式,只能改顏色背景色等,如果要那種效果可以用日歷插件
有個取巧的方法,一個不能改的input覆蓋在input type="date"上面
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style>
*{
margin: 0;
padding: 0;
}
#div{
width: 500px;
height: 300px;
border: 2px solid #ccc;
position: absolute;
}
.datebox{
width: 150px;
position: relative;
height: 24px;
margin: 100px;
}
#date{
position: absolute;
left: 1px;
top: 1px;
z-index: 50;
width: 100px;
height: 100%;
height: 22px;
border: 1px solid transparent;
}
.mydate{
width: 150px;
height: 24px;
border: 1px solid #CCC;
}
</style>
</head>
<body>
<div class="datebox">
<input type="text" id="date" readonly="readonly"/>
<input type="date" class="mydate" onchange="aaa(this)"/>
</div>
<script type="text/javascript">
function aaa(obj){
document.getElementById('date').value = obj.value;
}
</script>
</body>
</html>
添加回答
舉報