html中全局去除默认样式的方法
小编给大家分享一下html中全局去除默认样式的方法,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!

创新互联专业为企业提供麻城网站建设、麻城做网站、麻城网站设计、麻城网站制作等企业网站建设、网页设计与制作、麻城企业网站模板建站服务,十年麻城做网站经验,不只是建网站,更提供有价值的思路和整体网络服务。
html元素有默认样式,去除的方法:1、全局去除默认样式,代码为【*{padding:0;margin:0;box-sizing:..}】;2、a标签去除默认样式,代码为【a{text-decoration: none;color:#3】。
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、h2
h2,h3,h4,h5,h6,h7{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中全局去除默认样式的方法
当前地址:http://www.jxjierui.cn/article/popipp.html


咨询
建站咨询
