初始化样式的代码

/* 定义jd主题色变量 */
@main-color:#de181b;

/* 1. 放样式初始化 */

  • {
    margin: 0px;
    padding: 0px;
    /* 移动端都会设置盒模型为border-box /
    box-sizing: border-box;
    /
    去掉内边框 /
    outline: 0;
    /
    去除a标签的按住高亮背景色 */
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    }

input,
select {
/* 消除输入框和按钮的原生外观,在iOS上加上这个属性才能给按钮和输入框自定义样式 /
/
另外,select加上这个属性后,select的高度就可以改变了 /
-webkit-appearance: none;
}
/
去掉小圆点 */
li {
list-style: none;
}

img {
/* 去除图片3px间隙 */
vertical-align: middle;
}

a {
background: transparent;
text-decoration: none;
/* 设置a标签的高亮背景色 手指按住的时候会出现 */
-webkit-tap-highlight-color: transparent;
color: #666;
}

/* 样式初始化 */

html {
font-family: “Helvetica Neue”, Helvetica, STHeiTi, Arial, sans-serif;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
/font-size: 62.5%;/
}

body {
margin: 0;
/* 默认网页字体都使用了14px /
font-size: 14px;
/
line-height: 1.5; */
color: #333333;
background-color: white;
height: 100%;
overflow-x: hidden;
-webkit-overflow-scrolling: touch;
}

article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section,
summary {
display: block;
}

audio,
canvas,
progress,
video {
display: inline-block;
vertical-align: baseline;
}

audio:not([controls]) {
display: none;
height: 0;
}

[hidden],
template {
display: none;
}

svg:not(:root) {
overflow: hidden;
}

a:active {
outline: 0;
}

a:active {
color: #006699;
}

abbr[title] {
border-bottom: 1px dotted;
}

b,
strong {
font-weight: bold;
}

dfn {
font-style: italic;
}

mark {
background: #ff0;
color: #000;
}

small {
font-size: 80%;
}

sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}

sup {
top: -0.5em;
}

sub {
bottom: -0.25em;
}

img {
border: 0;
vertical-align: middle;
}

hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}

pre {
overflow: auto;
white-space: pre;
white-space: pre-wrap;
word-wrap: break-word;
}

code,
kbd,
pre,
samp {
font-family: monospace, monospace;
font-size: 1em;
}

button,
input,
optgroup,
select,
textarea {
color: inherit;
font: inherit;
margin: 0;
}

button {
overflow: visible;
}

button,
select {
text-transform: none;
}

button,
html input[type=“button”],
input[type=“reset”],
input[type=“submit”] {
-webkit-appearance: button;
cursor: pointer;
}

button[disabled],
html input[disabled] {
cursor: default;
}

button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}

input {
line-height: normal;
border: 0;
outline: 0;
}

input[type=“checkbox”],
input[type=“radio”] {
box-sizing: border-box;
padding: 0;
}

input[type=“number”]::-webkit-inner-spin-button,
input[type=“number”]::-webkit-outer-spin-button {
height: auto;
}

input[type=“search”] {
-webkit-appearance: textfield;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}

input[type=“search”]::-webkit-search-cancel-button,
input[type=“search”]::-webkit-search-decoration {
-webkit-appearance: none;
}

legend {
border: 0;
padding: 0;
}

textarea {
overflow: auto;
resize: vertical;
}

optgroup {
font-weight: bold;
}

table {
border-collapse: collapse;
border-spacing: 0;
}

td,
th {
padding: 0;
}

html,
button,
input,
select,
textarea {
font-family: “Helvetica Neue”, Helvetica, STHeiTi, Arial, sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
form,
blockquote {
margin: 0;
}

ul,
ol,
li,
dl,
dd {
margin: 0;
padding: 0;
}

ul,
ol {
list-style: none outside none;
}

h1,
h2,
h3 {
line-height: 2;
font-weight: normal;
}

h1 {
font-size: 18px;
}

h2 {
font-size: 16px;
}

h3 {
font-size: 14px;
}

input::-moz-placeholder,
textarea::-moz-placeholder {
color: #cccccc;
}

input:-ms-input-placeholder,
textarea:-ms-input-placeholder {
color: #cccccc;
}

input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
color: #cccccc;
}

/* 2. 放所有页面都会用到公共类 */

/* 边框的公共类名 */
.bt{
border-top: 1px solid #ccc;
}
.bb{
border-bottom: 1px solid #ccc;
}
.bl{
border-left: 1px solid #ccc;
}
.br{
border-right: 1px solid #ccc;
}

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值