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


本文摘自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;

    // 设置使所有a标签的四种状态都和本身颜色保持一致,样式代码自己写

}

3、li

1

ul,ol{list-style: none;}

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;//用于IOS下移除原生样式

}

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

阅读剩余部分

相关阅读 >>

Html中移动端有哪些布局方案

Html web服务器

Html中添加图片的代码是什么?Html如何正确的添加图片路径?

Html 文字的左右来回移动 <marquee>

语义化的Html结构对布局的好处是什么?

Html的 <nav> 标签

Html实现海康摄像头实时监控功能_Html/xHtml_网页制作

如何设置Html select下拉框的默认值?

Html获取javascript变量值的方法有哪些

Html有哪些行内块元素

更多相关阅读请进入《Html》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...