移动端base样式文件的一些基本设置
2020-04-16 本文已影响0人
blue_angel
如设计稿为750px,以375px来量宽,量取设计稿像素100px的话,100/2/16=3.125rem
* {
margin: 0;
padding: 0;
font-family: 'Heiti SC', 'Microsoft YaHei';
}
html {
height: 100%;
width: 100%;
font-family: 'Heiti SC', 'Microsoft YaHei';
font-size: 16px;
outline: 0;
-webkit-text-size-adjust:none;
}
body {
height: 100%;
-webkit-user-select: none;
background-color: #ececec;
}
a,body,button,dd,div,dl,dt,fieldset,form,h1,h2,h3,h4,h5,h6,html,img,input,li,ol,p,span,td,textarea,th,ul {
margin: 0;
padding: 0;
}
img {
width: 100%;
height: 100%;
vertical-align: middle;
}
button,input,textarea,select {
outline: none;
}
button { border: none; }
dd,dl,dt,li,ol,ul {
border: 0;
list-style: none;
}
h1,h2,h3,h4,h5,h6 {
font-weight: normal;
}
b,em {
font-style: normal;
}
a {
color: #333;
text-decoration: none;
}
input { font-size: 0.875rem;}
.clearfix:before, .clearfix:after{
display: table;
content: "";
}
.clearfix:after{
clear: both;
}
.fl { float: left; }
.fr { float: right; }
.hide { display: none!important; }
.show { display: block!important; }
/*top begin*/
#top {
position:fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: 1000;
width: 100%;
height: 44px;
line-height: 44px;
background-color: #f10215;
color: #fff;
font-size: 1.125rem;
text-align: center;
box-sizing: border-box;
z-index: 20;
overflow: hidden;
}
.topTitle {
position: relative;
text-align: center;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
width: 100%;
height: 44px;
box-sizing: border-box;
}
.leftPic,.rightPic {
position: absolute;
top: 0;
}
.leftPic {
width: 35px;
left: 0;
z-index: 2000;
}
.rightPic {
width: 49px;
right: 0;
}
.goBack,.userIcon,.closeBtn {
width: 24px;
height: 24px;
display: inline-block;
background: url(../images/tow_icon.png) no-repeat;
background-size: 250px 250px;
position: relative;
}
.goBack {
background-position: -6px -8px;
top: 8px;
}
.userIcon {
background-position: -6px -42px;
top: 4px;
}
.closeBtn {
width: 14px!important;
height: 14px!important;
background-position: -233px -151px;
top: 0;
}
.finish {
font-size: 1rem;
color: #fff;
}
/*footer begin*/
#footer {
width: 100%;
height: 50px;
background-color: #fff;
position: fixed;
bottom: 0;
left: 0;
right: 0;
border-top: 1px solid #ddd;
}
#footer ul {
width: 100%;
height: 100%;
}
#footer ul li {
float: left;
height: 100%;
width: 33.33333%;
text-align: center;
}
#footer ul li.active a {
color: #f10215;
}
#footer ul li a {
padding-top: 6px;
height: 100%;
display: block;
font-size: 0.6875rem;
}
#footer ul li span {
display: block;
width: 35px;
height: 22px;
margin: 0 auto;
background: url(../images/tow_icon.png) no-repeat;
background-size: 250px 250px;
}
#footer ul li span.icon-home { background-position: -30px -42px; }
#footer ul li span.icon-tool { background-position: -65px -42px; }
#footer ul li span.icon-mine { background-position: -100px -42px; }
#footer ul li.active .icon-home { background-position: -135px -42px; }
#footer ul li.active .icon-tool { background-position: -170px -42px; }
#footer ul li.active .icon-mine { background-position: -205px -42px; }
#contentWrapper {
width: 100%;
height: 100%;
padding-top: 44px;
box-sizing: border-box;
}
.banner-wrap {
width: 100%;
}
.margin-top-8 {
margin-top: 0.25rem;
}
.btn {
border: none;
font-size: 0.75rem;
padding: 0.375rem;
background-color: transparent;
border-radius: 6px;
}
.btn-default {
border: 1px solid #ccc;
color: #484848;
}
.btn-danger,.btn-botder-big {
border: 1px solid #f10215;
color: #f10215;
}
.btn-big {
background-color: #f23030;
color: #fff;
}
.btn-normal {
background-color: #78a2d9;
color: #fff;
}
.btnBigger {
font-size: 1rem;
color: #fff;
width: 7.5rem;
height: 2.75rem;
}
.btn-botder-big {
font-size: 1rem;
border-radius: 20px;
width: 7.5rem;
height: 2.75rem;
}
/*弹框 begin*/
.layout {
position: absolute;
z-index:2;
top:0;
left:0;
width:100%;
height:100%;
background-color: rgba(0,0,0,0.7);
position:fixed!important;
_top: expression_r(eval_r(document.compatMode &&
document.compatMode=='CSS1Compat') ?
documentElement.scrollTop + (document.documentElement.clientHeight-this.offsetHeight)/2 :
document.body.scrollTop + (document.body.clientHeight - this.clientHeight)/2);
}
.layout-wrapper {
background-color: #fff;
position: fixed;
z-index: 3;
left: 50%;
top: 50%;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.hint-wrap {
width: 286px;
height: 190px;
color: #585858;
text-align: center;
margin-left: -143px;
margin-top: -95px;
}
.hint-title {
font-size: 1.125rem;
color: #e02222;
line-height: 2.5rem;
padding: 0 0.9375rem;
text-align: left;
border-bottom: 3px solid #e02222;
}
.hint-txt {
width: 100%;
display: table;
height: 6.625rem;
}
.hint-txt p {
font-size: 0.875rem;
vertical-align: middle;
display: table-cell;
}
.btn-box {
width: 100%;
border-top: 1px solid #ddd;
position: absolute;
bottom: 0;
}
.btn-box button {
width: 50%;
text-align: center;
font-size: 1rem;
color: #666;
line-height: 2.5rem;
background-color: #fff;
border-right: 1px solid #ddd;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-ms-border-radius: 4px;
-o-border-radius: 4px;
border-radius: 4px;
}
.btn-box button:last-child {
border-right: none;
}
.wper100 { width: 100%!important; }
/*loading begin*/
.loading-wrap {
width: 184px;
height: 64px;
margin-left: -92px;
margin-top: -32px;
position: absolute;
top: 50%;
left: 50%;
z-index: 10000;
border-radius: 6px;
background-color: #fff;
display: -none;
}
.loading-txt {
width: 100%;
text-align: center;
}
.loading-txt span {
font-size: 14px;
color: #27a9e3;
padding-left: 38px;
padding-top: 20px;
display: inline-block;
}
@-webkit-keyframes loading-3 {
50% {
transform: scale(0.4);
opacity: 0.3;
}
100% {
transform: scale(1);
opacity: 1;
}
}
.loading-3 {
position: relative;
top: 28px;
left: 36px;
}
.loading-3 i {
display: inline-block;
width: 6px;
height: 6px;
border-radius: 50%;
background-color: #1ea6e3;
position: absolute;
}
.loading-3 i:nth-child(1) {
top: 14px;
left: 0;
-webkit-animation: loading-3 1s ease 0s infinite;
}
.loading-3 i:nth-child(2) {
top: 10px;
left: 10px;
-webkit-animation: loading-3 1s ease -0.12s infinite;
}
.loading-3 i:nth-child(3) {
top: 0;
left: 14px;
-webkit-animation: loading-3 1s ease -0.24s infinite;
}
.loading-3 i:nth-child(4) {
top: -10px;
left: 10px;
-webkit-animation: loading-3 1s ease -0.36s infinite;
}
.loading-3 i:nth-child(5) {
top: -14px;
left: 0;
-webkit-animation: loading-3 1s ease -0.48s infinite;
}
.loading-3 i:nth-child(6) {
top: -10px;
left: -10px;
-webkit-animation: loading-3 1s ease -0.6s infinite;
}
.loading-3 i:nth-child(7) {
top: 0;
left: -14px;
-webkit-animation: loading-3 1s ease -0.72s infinite;
}
.loading-3 i:nth-child(8) {
top: 10px;
left: -10px;
-webkit-animation: loading-3 1s ease -0.84s infinite;
}