gpt4 book ai didi

CSS 重置不适用于 Firefox 和文本

转载 作者:太空宇宙 更新时间:2023-11-04 15:23:00 25 4
gpt4 key购买 nike

我一直致力于 Eric Meyer CSS Reset。我有一个文本很重的网站。重置适用于边距。但它对字体和字体大小不起作用。 Firefox 似乎使所有文本都变小了,即使我进行了重置。有什么方法可以在 CSS 代码中解决这个问题吗?

或者是否有任何有效的 Firefox hacks?如果你想看看我的问题是什么,请在 chrome 中加载我的页面,然后在 Firefox 中加载它并进行比较:http://emilymagnuson.com/mynews/index.html

此外,我是初学者,所以如果我明显遗漏了什么,请告诉我。将不胜感激。

谢谢!

/* http://meyerweb.com/eric/tools/css/reset/ 
v2.0 | 20110126
License: none (public domain)
*/

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;
}


#box {
background-color: #0F3;
margin: 0px;
float: left;
height: 200px;
width: 300px;
padding-top: 0px;
padding-right: 0px;
padding-bottom: 0px;
padding-left: 0px;
font-family: "Courier New", Courier, monospace;
font-size: 1em;
color: #F00;
}

最佳答案

提到的 reset.css 没有链接到 the site you've linked above !

此外,这对我来说似乎是一个舍入错误。

您的 CSS 规则:

.BodyType {
font-size: 1.125em;
line-height: 1.65em;
}

Firefox 和 Chromium 都显示 1.125em 的字体大小,而 Opera 在 Dragonfly 中显示 1.13em

包含 reset.css 并使用完整的测试用例对其进行测试。如果仍然存在差异,请尝试将小数位数限制为两位(例如 1.13em)。

如果您在 body 元素上为字体大小设置像素值,请尝试使用可生成整数值的分数。例如,10px 的基本字体大小和 1.125em 的元素字体大小将导致计算出的 11.25px 字体大小,而1.2em 的元素字体大小将导致计算出的 12px 字体大小。

关于CSS 重置不适用于 Firefox 和文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14365674/

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