微端頁面縮放比:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
防止IE默認選中Quirks文檔模式:
<meta http-equiv="X-UA-Compatible" content="ie=edge">
防止ban圖背景失真可設置最小寬(版心寬度min-width:1000px;):
width: 100%;
height: 500px;
background: url(../image/comp-ban.png)center no-repeat;
margin: 0 auto;
兼容IE7仿input placeholder效果:
<input class="agen-foot-inp01" type="text" value="您的姓名" "if(this.value === '您的姓名') this.value = '';" "if(this.value === '') this.value = '您的姓名';">
或者寫一個p標籤模仿一個佔位.calc-placeholder(父元素如li,div).calc-inps-tog(input框).calc-show(p標籤)
$('.calc-placeholder .calc-inps-tog').focus(function(){
$(this).siblings('.calc-show').hide();
});
$('.calc-placeholder .calc-show').click(function(){
$(this).hide();
$(this).siblings('.calc-inps-tog').focus();
});
$('.calc-placeholder .calc-inps-tog').blur(function(){
var aa = $(this).val();
if (aa === '') {
$(this).siblings('.calc-show').show();
}else{
$(this).siblings('.calc-show').hide();
}
});
if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.match(/8./i)=="8."){
$('.calc-show').show();
}
else if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.match(/9./i)=="9."){
$('.calc-show').show();
}
側邊跟隨版心移動:
.fixed{
width: 100px;
height: 300px;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
margin: auto;
right: 50%;
margin-right: -600px;
}