如何重置全局 vue2的全局css
时间: 2024-05-10 08:15:28 浏览: 6
要重置 Vue2 的全局 CSS,你可以添加以下样式表:
```css
/* Reset */
html,
body,
div,
span,
object,
iframe,
figure,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
abbr,
address,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
samp,
small,
strong,
sub,
sup,
var,
b,
i,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* Box-sizing */
*,
*:before,
*:after {
box-sizing: border-box;
}
/* Remove list styles */
ol,
ul {
list-style: none;
}
/* Typography */
body {
line-height: 1;
font-size: 16px;
font-family: sans-serif;
}
/* Links */
a {
color: inherit;
text-decoration: none;
}
/* Tables */
table {
border-collapse: collapse;
border-spacing: 0;
}
/* Images */
img {
max-width: 100%;
height: auto;
}
```
将上述 CSS 添加到你的 `index.html` 文件中,或者添加到你的 Vue2 项目的全局样式表中。这将重置所有元素的样式,并为文本、链接、表格和图像提供一些基本样式。