给我写一个重置默认样式
以下是一个基本的重置默认样式的示例,可以在所有浏览器上使用:
/* 重置所有元素的默认样式 */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
/* 重置所有标题的默认样式 */
h1, h2, h3, h4, h5, h6 {
font-size: 1em;
font-weight: normal;
}
/* 重置所有列表的默认样式 */
ul, ol {
list-style: none;
}
/* 重置所有链接的默认样式 */
a {
text-decoration: none;
color: inherit;
}
/* 重置所有表单元素的默认样式 */
input, textarea, button, select {
border: none;
outline: none;
background: none;
font-family: inherit;
font-size: inherit;
color: inherit;
}
/* 重置所有按钮的默认样式 */
button {
cursor: pointer;
}
/* 重置所有图片的默认样式 */
img {
max-width: 100%;
height: auto;
}
这个示例主要包括以下内容:
- 重置所有元素的默认边距和内边距
- 重置所有标题的默认字体大小和加粗程度
- 重置所有列表的默认样式
- 重置所有链接的默认样式
- 重置所有表单元素的默认样式
- 重置所有按钮的默认样式
- 重置所有图片的默认尺寸
当然,这只是一个基本示例,您可以根据自己的需求,添加或删除其他样式规则。
原文地址: https://www.cveoy.top/t/topic/ba5i 著作权归作者所有。请勿转载和采集!