ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

Css样式初始化

2021-04-07 20:34:01  阅读:149  来源: 互联网

标签:初始化 none 样式 text th font border Css size


web端常用公共样式

html{
	color:#000;
	background:#FFF;
}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td,footer,article,aside,header,section,nav,figure,figcaption,hgroup{
	margin:0;
	padding:0;
}table{
	border-collapse:collapse;
	border-spacing:0;
}fieldset,img{
	border:0;
}address,caption,cite,code,dfn,em,strong,th,var{
	font-style:normal;
	font-weight:normal;
}ol,ul{
	list-style:none;
}caption,th{
	text-align:left;
}h1,h2,h3,h4,h5,h6{
	font-size:100%;
	font-weight:normal;
}q:before,q:after{
	content:'';
}abbr,acronym{
	border:0;
	font-variant:normal;
}sup{
	vertical-align:text-top;
}sub{
	vertical-align:text-bottom;
}input,textarea,select{
	font-family:inherit;
	font-size:inherit;
	font-weight:inherit;
	*font-size:100%;
}legend{
	color:#000;
}#yui3-css-stamp.cssreset{ display:none}

移动端常用公共样式

@charset "utf-8";
/* 清零 */
*:focus{outline: none;}
html{
    /*禁用iPhone中Safari的字号自动调整*/
    -webkit-text-size-adjust:100%;
    -ms-text-size-adjust:100%;
    /* 解决IOS默认滑动很卡的情况 */
    -webkit-overflow-scrolling : touch;
    font-size: 100px;
    font-size: 26.6666667vw;
}
@media (min-width: 640px) {
    html{
        font-size: 170px;
    }
}
body{font-size: 0.12rem; font-family:'Microsoft YaHei', Tahoma,Arial,"Roboto","Droid Sans","Helvetica Neue","Droid Sans Fallback","STHeiti",sans-serif;}
/*去除iPhone中默认的input样式*/
input{-webkit-appearance:none; resize:none;}
/*取消链接高亮*/
body,div,ul,li,ol,h1,h2,h3,h4,h5,h6,input,textarea,select,select,p,dl,dt,dd,a,img,button,form,table,th,th,tr,th,tbody,article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{-webkit-tap-hightlight-color:rgba(0,0,0,0);    -webkit-tap-highlight-color: transparent; margin: 0;padding: 0;border: none; }
/*设置HTML5元素为块级元素*/
article,aside,details,figcaption,figure,footer,hgroup,menu,nav,section{display: block;}
/*图片自适应*/
img{max-width: 100%;height: auto;width:auto; /*IE8*/-ms-interpolation-mode:bicubic;vertical-align: top /*为了照顾IE图片缩放失真*/}


em,i,strong{font-style: normal;}
.clearfix:after{content: "";display: block;visibility: hidden;height: 0; clear: both;}
.clearfix{zoom:1}
a{text-decoration: none;color: #929292;font-family:'Microsoft YaHei', Tahoma,Arial,"Roboto","Droid Sans","Helvetica Neue","Droid Sans Fallback","STHeiti",sans-serif;}
a:hover{color: #929292; text-decoration: none;}
ul,ol,li{list-style: none;}
h1,h2,h3,h4,h5,h6{font-size: 100%; font-family:'Microsoft YaHei', Tahoma,Arial,"Roboto","Droid Sans","Helvetica Neue","Droid Sans Fallback","STHeiti",sans-serif;}
fieldset,img{border: none;}
table{border-collapse: collapse;border-spacing: 0;}
caption,th{text-align: left;}
q:before,q:after{content: "";}
/*禁止表单使用文本框输入法*/
input.password{ime-mode: disabled;}
.scope{max-width: 640px;margin: 0 auto;}
.clear{clear: both;}
/*连续英文,数字换行*/
.wordwrap{word-break: break-all;word-wrap: break-word;}
/*单行文字超出显示省略号*/
.omg{overflow: hidden;text-overflow:ellipsis ;white-space: nowrap;}

*{box-sizing: border-box;}

/* 禁止长按链接与图片弹出菜单 */
a, img {-webkit-touch-callout: none;}
/* 禁止选中文本(如无文本选中需求,此为必选项) */
html, body {-webkit-user-select: none;user-select: none;}

标签:初始化,none,样式,text,th,font,border,Css,size
来源: https://www.cnblogs.com/shandou/p/14629415.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有