gpt4 book ai didi

css - Firefox 默认字体大小问题

转载 作者:太空宇宙 更新时间:2023-11-04 16:17:01 24 4
gpt4 key购买 nike

灵活的布局使用 em 或 % 作为字体大小单位,常见的做法是使用 body font-size 作为 62.5%

但是 Firefox 的默认字体是 14px,这导致布局比其他默认字体大小为 16px 的小

我们不能将 body font-size 固定为 10px,以便相对大小在每个浏览器中都适用。

最佳答案

此外,除了@Ray 的回答..

对于像这样的浏览器不一致问题,请考虑使用重置样式表。

好的可以找here .和 here .

我将代码粘贴在这里以供引用。

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, output, ruby, section, summary,
time, mark, audio, video {
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;
}

关于css - Firefox 默认字体大小问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7281436/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com