全局css样式重置
发布日期:2021-05-18 07:03:40 浏览次数:20 分类:精选文章

本文共 1088 字,大约阅读时间需要 3 分钟。

全局CSS样式重置是一种标准化浏览器默认样式的方法,用于确保不同浏览器在显示网页时的一致性。这种方法通过覆盖浏览器内置的默认样式,统一页面元素的外观表现。

以下是通用全局CSS重置样式规范:

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,del, dfn, em, img, ins, kbd, q, s, samp,small, strike, strong, sub, sup, tt, var,
b, u, i, center, dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, section,
mark {margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline;}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {display: block;}
body {line-height: 1;}
ol, ul {list-style: none;}
blockquote, q {quotes: none;}
blockquote:before, blockquote:after, q:before, q:after {content: ''; content: none;}
table {border-collapse: collapse; border-spacing: 0;}

这种样式重置方法主要目标是去除浏览器不一致的问题,确保开发者对页面元素的布局和样式有更好的控制能力。建议在开发项目时根据具体需求针对特殊情况进行特性调整。

上一篇:史上最全常用正则表
下一篇:ajax优缺点

发表评论

最新留言

路过,博主的博客真漂亮。。
[***.116.15.85]2025年05月06日 07时41分24秒