本文摘自PHP中文网,作者coldplay.xixi,侵删。
html元素有默认样式,去除的方法:1、全局去除默认样式,代码为【*{padding:0;margin:0;box-sizing:..}】;2、a标签去除默认样式,代码为【a{text-decoration: none;color:#3】。

本教程操作环境:windows7系统、html5版,DELL G3电脑。
html元素有默认样式,去除的方法:
1、全局去除默认样式
1 | *{padding:0;margin:0;box-sizing: border-box;font-size: 14px;}
|
2、a标签去除默认样式
1 2 3 4 5 | a{text-decoration: none;color:#333;}
a:hover, a:visited, a:link, a:active {
color:#333;
}
|
3、li
4、img
1 2 3 4 | img{
vertical-align:top;
border:none;
}
|
5、button
1 2 3 4 5 6 | .button{
border:0;
background-color:none
outline:none;
-webkit-appearance: none;
}
|
6、select
1 2 3 4 5 6 7 8 9 | 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
阅读剩余部分
相关阅读 >>
javascript怎么修改Html标签属性
Html的版本
向Html中插入视频并兼容所有浏览器的方法
Html调用php
Html文本区域大小怎么设置
Html i标签怎么用
Html怎么引入js文件?
Html怎么给button设置图片
Html怎么设置只读
Html和css的面试知识点总结(附示例)
更多相关阅读请进入《Html》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » html元素有哪些自带样式,如何去除