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

阅读剩余部分

相关阅读 >>

javascript怎么修改Html标签属性

Html的版本

Html中插入视频并兼容所有浏览器的方法

Html调用php

Html文本区域大小怎么设置

Html i标签怎么用

Html怎么引入js文件?

Html怎么给button设置图片

Html怎么设置只读

Html和css的面试知识点总结(附示例)

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




打赏

取消

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

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

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

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

评论

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