
本教程操作环境:windows7系统、html5版,DELL G3电脑。
html元素有默认样式,去除的方法:
1、全局去除默认样式
*{padding:0;margin:0;box-sizing: border-box;font-size: 14px;}登录后复制2、a标签去除默认样式
a{text-decoration: none;color:#333;}
a:hover, a:visited, a:link, a:active {
color:#333;
// 设置使所有a标签的四种状态都和本身颜色保持一致,样式代码自己写
}登录后复制3、li
ul,ol{list-style: none;}登录后复制4、img
img{
vertical-align:top;
border:none;
}登录后复制5、button
.button{
border:0;
background-color:none
outline:none;
-webkit-appearance: none;//用于IOS下移除原生样式
}登录后复制6、select
select {
border: none;
appearance:none;
-moz-appearance:none;
-webkit-appearance:none;
/*在选择框的最右侧中间显示小箭头图片*/
background: url("http://ourjs.github.io/static/2015/arrow.png") no-repeat scroll right center transparent;
padding-right: 14px;
}登录后复制7、h1
h1,h2,h3,h4,h5,h6{font-weight:normal;}登录后复制8、input,textarea
input,textarea {
outline: none;
border: none;
}
textarea {
resize: none;
overflow: auto;
}登录后复制9、斜体 i
i{font-style: normal;}登录后复制10、table
table{border-collapse:collapse;border-spacing:0;}登录后复制11、去除input[type=number]加减号
/*去除input[type=number]加减号*/
/* 谷歌 */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
appearance: none;
margin: 0;
}
/* 火狐 */
input{
-moz-appearance:textfield;
}登录后复制以上就是html元素有哪些自带样式,如何去除的详细内容,更多请关注靠谱客其它相关文章!

最后
以上就是害羞龙猫最近收集整理的关于html元素有哪些自带样式,如何去除的全部内容,更多相关html元素有哪些自带样式内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复