CSS样式格式化

1.采用淘宝的css样式初始化(不建议使用通配符*,会影响页面加载速度)

body,
h1, h2, h3, h4, h5, h6, hr, p, blockquote, dl, dt, dd, ul, ol, li, pre, form, fieldset, legend, button, input, textarea, th, td {
    margin: 0;
    padding: 0;
}

body, button, input, select, textarea {
    font: 12px/1.5 tahoma, arial, \5b8b\4f53;
}

h1, h2, h3, h4, h5, h6 {
    font-size: 100%;
}

address, cite, dfn, em, var {
    font-style: normal;
}

code, kbd, pre, samp {
    font-family: couriernew, courier, monospace;
}

small {
    font-size: 12px;
}

ul, ol {
    list-style: none;
}

a {
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

sup {
    vertical-align: text-top;
}

sub {
    vertical-align: text-bottom;
}

legend {
    color: #000;
}

fieldset, img {
    border: 0;
}

button, input, select, textarea {
    font-size: 100%;
}

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

2.一些常用的Class

/* 右浮动 */
.right {
    float: right;
}

/* 左浮动 */
.left {
    float: left;
}

/* 表单文字溢出隐藏,用...显示 */
table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-fix {
    table-layout: fixed;
}

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

.clearfix {
    *zoom: 1;
}

 

 

你可能感兴趣的:(前端开发规范)