鹿泽鹿泽  2024-07-16 16:43:17 鹿泽笔记 隐藏边栏  0 

改新模板的时候考虑到单独适配手机端排版美化。只需要在css内写好窗口大小相对应的样式。访问就根据窗口大小自动使用相应的样式。

/*手机端适配  常规尺寸*/
@media (max-width:768px) {
	
.hh_usertop .user_av img {
    float: left;
    width: 50px;
    height: 50px;
    border-radius: 5px;
    margin-top: 15px;
}	
.hh_usertop {
    margin-left: 12px;
    height: 120px;
    max-width: 1380px;
}
.hh_ziliao {
    position: relative;
    top: 1px!important;
    text-align: right;
    width: 100%;
	text-align: right; 
}
.user_row {
    position: relative!important;
    top: 40px!important;
}
.user_row li { 
    margin-right: 10px!important;
}
.hh_p2 {
    display: block;
    margin: 0;
    color: gray;
    font-weight: 300;
    font-size: 14px!important;
}
}
/*iphone X 适配*/
@media only screen and (device-width:375px) and (device-height:812px) and (-webkit-device-pixel-ratio:3) {
	.user_row li { 
    margin-right: 55px!important;
}
.hh_ziliao { 
    margin-left: -80px; 
}}
/*iphone 6/7/8 适配*/
@media only screen and (device-width:375px) and (device-height:667px)   {
	.user_row li {
    margin-right: 4px!important;
}
.hh_ziliao {
    margin-left: -80px;
}
	
}
/*iPhone 5/SE适配*/
@media only screen and (device-width:320px) and (device-height:568px)   {
	.hh_usertop .user_av img { 
    width: 40px;
    height: 40px; 
}
	.hh_usertop {
    margin-left: 1px;
    padding-top: 80px;
    padding-left: 15px;
    height: 160px;
    max-width: 1380px;
}
    .hh_p2 {
    font-size: 0px!important;
    }
    .hh_ziliao #udptips { 
    top: 20px!important; 
    padding: 1px 1px!important; 
    }
    .hh_ziliao .hh_user_vips {
    top: 33px!important;
    padding: 6px 10px!important;
}
	.hh_ziliao {  
    margin-left: -20px; 
    width: 100%;
    text-align: right;
	}
    .user_row ul li a.active {
     border-bottom: 0px solid #1990fc!important; 
    color: #2700ff!important;
}   
}
/*移动端适配结束*/
1、文章版权归作者所有,未经允许请勿转载。
2、本站所有文章,如无特殊说明或标注,均为本站原创发布。任何在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们邮箱:526009505@qq.com进行处理。
3、咨询请联系QQ:526009505