Home > Web Front-end > HTML Tutorial > CSS重置标签默认样式_html/css_WEB-ITnose

CSS重置标签默认样式_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:31:26
Original
1215 people have browsed it

CSS重置标签默认样式:
建议:尽可能的手写代码,可以有效的提高学习效率和深度。
在默认情况下,很多标签都有自带的属性,例如body自带有margin、ul有自带的padding、h1-h6的字体大小各部相同、li前面带有的小圆圈等等。这些自带的默认属性会给实际的布局中带来不少的麻烦,我们可以再样式表的开始就重置这些默认的属性。实例如下:

<!DOCTYPE html><html><head><meta charset=" utf-8"><meta name="author" content="http://www.softwhy.com/" /><title>蚂蚁部落</title><style type="text/css">body, ul, li, h1, h2, h3, h4, h5, h6, p{  margin:0px;  padding:0px;  list-style:none;  font-size:12px;  font-weight:normal;}</style></head><body><h1>标题一</h1><h2>标题二</h2><h3>标题三</h3><h4>标题四</h4><h5>标题五</h5><h6>标题六</h6><ul>  <li>列表项一</li>  <li>列表项二</li></ul><p>我是一个段落</p></body></html>
Copy after login

原文地址是:http://www.softwhy.com/forum.php?mod=viewthread&tid=4736

更多内容可以参阅:http://www.softwhy.com/divcss/

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template