首页 > Web开发 > 详细

css常用样式设置

时间:2017-12-20 11:46:01      阅读:213      评论:0      收藏:0      [点我收藏+]

设置用户不能选择文字:

body,
.noselect {
    -webkit-touch-callout: none;
    /* iOS Safari */
    -webkit-user-select: none;
    /* Chrome/Safari/Opera */
    -khtml-user-select: none;
    /* Konqueror */
    -moz-user-select: none;
    /* Firefox */
    -ms-user-select: none;
    /* Internet Explorer/Edge */
    user-select: none;
    /* Non-prefixed version, currently
    not supported by any browser */
}

图片初始化:

img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    margin: 0 auto;
}

设置隐藏:

.hidden {
    display: none;
}

 浏览器初始化:

// 盒模型
body,
div,
dl,
dt,
dd,
ul,
ol,
li,
h1,
h2,
h3,
h4,
h5,
h6,
pre,
code,
form,
fieldset,
legend,
input,
button,
textarea,
p,
blockquote,
th,
td {
    margin: 0;
    padding: 0;
}
// 表格
table {
    border-collapse: collapse;
    border-spacing: 0;
}
// 列表
li {
    list-style: none;
}
// 标题
h1,
h2,
h3,
h4,
h5,
h6 {
    font-size: 100%;
    font-weight: normal;
}
// 表单
input,
button,
textarea,
select,
optgroup,
option {
    font-family: inherit;
    font-size: inherit;
    font-style: inherit;
    font-weight: inherit;
}
input,
button,
textarea,
select {
    *font-size: 100%;
}
select,
input,
select {
    vertical-align: middle;
}
// 链接
a {
    text-decoration: none;
}

 

css常用样式设置

原文:http://www.cnblogs.com/maoriaty/p/8072262.html

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