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 table表格标签内容如何居中显示?表格的align属性的用法介绍

Html iframe标签怎么用

Html可以用jstl标签么

怎么用Html写hello world

Html怎么禁止复制粘贴

Html如何调用外部css

关于Html页面跳转传递参数问题解答

Html 速查列表

Html表格边框怎么去掉

Html bdo标签怎么用

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




打赏

取消

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

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

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

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

评论

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