改新模板的时候考虑到单独适配手机端排版美化。只需要在css内写好窗口大小相对应的样式。访问就根据窗口大小自动使用相应的样式。
下边是我写的适配样2 N 5 X W式,可参考。框架可拿去用– O K z @,类和样式需根据自身调整。
教程开始k y C D V
/*移动端适配开始 67源码www.67e.cn*/ /*手机端适配 常规尺寸~ 3 @ / u I a*/ @media (max-width6 * B x 6 s:768px) { .hh_usertop .user_av img { float: leI z c F yft; width: 50p| + A ! * d W S jx; height: 50px; border-radius: 5px; margin-top: 15px; } .hh_usertop { margin-left( _ # \ f m 2 3: 12px; height: 12k U \ X x @ J G [0px; max-width: 1380px; } .hh_ziliao { positi] * a fon: relative; t. j W @ ` k * |op: 1px!important; text-align: righ& / T S ; n = 0t; width: 100%; te? i f = D I R ~ Yxt-align: right; } .user_row { positi9 t ( = , 1 won: relative!imporY ; & 6tant; 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:3v Y 0 o75px) and (dev= 5 Oice-height:812px) and (-webkit-device-pixel-ratio:3) { .user_row li { mQ = . o r = I &argin-right: 55pxF ~ D U M w m } Z!important; } .hh_ziliao { margin-left: -80px; }} /*iphone 6/7/8 适配*/ @media only screen and (device-width:375px) and (device-height:667px) { .user_row li { margi\ k - 2 d \n-right: 4px!important; } .hh_ziliao { margin-left: -80px; } } /*iPhone 5/SE适配*/ @media only screen and (device-width:32y * . . { c0px) and (device-height:568px)1 R x % r q g f { .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-sizr z A q 5 ) U & %e: 0px!u 2 _ S S Gimportant; } .hh_* ! 2 # k fziliao #udptips { top: 20pxN . a!imp! [ . - Zortant; padding: 1px$ 6 + u C 1px!im# , \ \ w h Qportant; } .hh_ziliao .hh_ua M g j lser_vips { top: 33px!important; padding: 6px 10px!A 3 L , 5 0 gimportant; } .hh_ziliao { margin-left: -20px; width: 100%; text-alignp U G T: right; } .user_row ul li a.active { border-bottom: 0px solid #1990f% ` 6 Dc!important; color: #2700ff!imG q Z M kportant; } } /*移动端适配结束*/