html元素有哪些自带样式,如何去除

html元素有默认样式,去除的方法:1、全局去除默认样式,代码为【*{padding:0;margin:0;box-sizing:..}】;2、a标签去除默认样式,代码为【a{text-decoration: none;color:#3】。

html元素有哪些自带样式,如何去除

本教程操作环境: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元素有哪些自带样式,如何去除的详细内容,更多请关注创想鸟其它相关文章!

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/1549206.html

赞 (0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
在html中图像标签是什么意思
上一篇 2025年12月21日 20:21:23
html里js怎么使用
下一篇 2025年12月21日 20:21:36

相关推荐

发表回复

登录后才能评论
关注微信