首页 > 其他 > 详细

样式重置

时间:2020-07-22 13:53:59      阅读:60      评论:0      收藏:0      [点我收藏+]
body,html{
    width: 100%;
    height: 100%;
    /*这样会使1rem=10px;或者子元素的1em=10px*/
    /* font-size: 62.5%; */
}
html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code,
del, dfn, em, img, ins, kbd, q, samp,
small, strong, sub, sup, var,
b, i,a,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section, summary,
time, mark, audio, video {
    font-size: 14px;
    margin:0;
    padding:0;
    /* border:0; */
    outline: 0;
    box-sizing: border-box;
    position: relative;
}
input,button,textarea,select{
    outline: 0;
    box-sizing: border-box;
}
h1,h2,h3,h4,h5,h6,em,i {
    font-weight: 100;
    font-style: normal;
}
ul,ol,li {
    list-style-type: none;
}
a {
    text-decoration: none;
    color: #fff;
}
button:active{
    transform: translateY(2px);
}

/* 常用公共样式 */
.flex_start{
    display: flex;
    align-items: center;
    justify-content:start;
}
.flex_around{
    display: flex;
    align-items: center;
    justify-content: space-around;
}
.flex_between{
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.top50{
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}
.left50{
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.topleft50{
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%,-50%);
}

/*清除浮动*/
.clearfix:after {
    content: ".";
    display: block;
    height: 0;
    clear: both;
    visibility: hidden;
}
.clearfix {display: inline-block;}

 

样式重置

原文:https://www.cnblogs.com/zwhbk/p/13359702.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!