为什么stylesheet指令不适用于FireFox? [英] Why does stylesheet directive not work with FireFox?

查看:78
本文介绍了为什么stylesheet指令不适用于FireFox?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Firefox不会采用以下font-weight:bold我的

样式表中的指令。 IE浏览器工作正常。


#rightMenuText h5 {

font-weight:bold;

padding-bottom:0px;

padding-top:10px;

margin-bottom:0px;

}


如果你在FF和IE中查看 http://www.clearpointsystems.com ,你可以看到

差异。我一直在尝试不同的东西,但似乎无法获得

粗体字体。我的代码有问题吗?或者这是另一个怪癖

与FF对IE?


这里是(缩写)代码:


< div id =" rightMenu">

< div id =" rightMenuBody">

< div id =" rightMenuText" >

< p> [image]< / p>

< h5>欢迎来到CSI< / h5>

[文字]

< h5>大新闻!< / h5>

[text]

< h5>安全问题< / h5> ;

[text]

< h5> [更多标题]< / h5>

[更多文字]

Firefox will not take the following "font-weight:bold" directive in my
stylesheet. Works fine in IE.

#rightMenuText h5 {
font-weight:bold;
padding-bottom:0px;
padding-top: 10px;
margin-bottom:0px;
}

If you view http://www.clearpointsystems.com in both FF and IE you can see
difference. I''ve been trying different things, but can''t seem to get the
bold font. Is there something wrong with my code? Or is this another quirk
with FF vs. IE?

Here''s the (abbreviated) code:

<div id="rightMenu">
<div id="rightMenuBody">
<div id="rightMenuText">
<p>[image]</p>
<h5>Welcome to CSI</h5>
[text]
<h5>Big News!</h5>
[text]
<h5>Security Matters</h5>
[text]
<h5>[more headings]</h5>
[more text]

推荐答案

> Firefox不会采用以下font-weight:bold我的
> Firefox will not take the following "font-weight:bold" directive in my
样式表中的指令。在IE中正常工作。
stylesheet. Works fine in IE.




我想出来了 - 我正在重新定义< h5>样式表中的标记。 IE

仍然将其渲染为h5,但不是FF。所以看起来粗体在IE中,但

仅作为FF中的常规文本。不同的浏览器以不同的方式渲染确切的

相同的代码 - 是的,网络编程的乐趣。



I figured it out - I was redefining the <h5> tag in the stylesheet. IE
still rendered it as an h5, but not FF. So it appeared "bold" in IE, but
only as regular text in FF. The different browsers were rendering the exact
same code differently - ah yes, the joy of web programming.


deko写道:
Firefox不会采用以下font-weight:bold我的
样式表中的指令。在IE中正常工作。


它在这里呈现 - XP与FF 1.0。


然而它看起来仍然与IE的版本非常不同。两者都是

粗体,但是在FF中,标题文本大约是它所处理的

文本大小的60%,因此大胆的效果在视觉上几乎丢失了。 />

对于字体大小有一些蠢事,仅此而已。


TBH我会期待FF的行为。包含标题的div的字体大小为10px,因此h5默认为大约6px&我没注意到你在其他地方明确设置了一个会影响h5的字体大小。


IE做了自己的事并不让我感到惊讶 - 它已经明确决定

你的决定是< polite>傻< / polite>一个&它知道的更好。


更奇怪的是,Opera 8做了类似于IE的事情 - 尽管我使用的是

web开发人员工具栏( http://nontroppo.org/wiki/WebDevToolbar )告诉

我为h5计算的样式它报告6px,这肯定不是它给它的b / b
。我猜他们不一定反映渲染中使用的最终决定: -

#rightMenuText h5 {
font-weight:bold ;
padding-bottom:0px;
padding-top:10px;
margin-bottom:0px;
}
如果你查看 http://www.clearpointsystems.com 在FF和IE中你都可以看到
的区别。我一直在尝试不同的东西,但似乎无法获得
粗体字体。我的代码有问题吗?或者这是与FF对IE的另一个怪癖吗?

这里是(缩写)代码:

< div id =" rightMenu" >
< div id =" rightMenuBody">
< div id =" rightMenuText">
< p> [image]< / p>
< h5>欢迎来到CSI< / h5>
[text]
< h5>大新闻了!< / h5>
[text]
< h5> ;安全事项< / h5>
[text]
< h5> [更多标题]< / h5>
[更多文字]
Firefox will not take the following "font-weight:bold" directive in my
stylesheet. Works fine in IE.
It renders it here - XP with FF 1.0.

However it does still look very different to IE''s version. Both are
bold, but in FF the heading text is approximately 60% of the size of the
text it heads, hence the bold effect is visually almost lost.

There''s something daft going on with font sizes, nothing more.

TBH I''d expect FF''s behaviour. The div containing the heading has a
font-size of 10px, so h5 would default to about 6px & I didn''t notice
you explicitly setting a font size elsewhere that would affect h5.

That IE does its own thing doesn''t surprise me - it''s clearly decided
your decision is a <polite>silly</polite> one & it knows better.

More oddly, Opera 8 does something similar to IE - though if I use the
web developer toolbar (http://nontroppo.org/wiki/WebDevToolbar) to tell
me the computed styles for h5 it reports 6px which certainly isn''t how
it renders it. I''d guess they don''t necessarily reflect the final
decisions used in rendering :-/

#rightMenuText h5 {
font-weight:bold;
padding-bottom:0px;
padding-top: 10px;
margin-bottom:0px;
}

If you view http://www.clearpointsystems.com in both FF and IE you can see
difference. I''ve been trying different things, but can''t seem to get the
bold font. Is there something wrong with my code? Or is this another quirk
with FF vs. IE?

Here''s the (abbreviated) code:

<div id="rightMenu">
<div id="rightMenuBody">
<div id="rightMenuText">
<p>[image]</p>
<h5>Welcome to CSI</h5>
[text]
<h5>Big News!</h5>
[text]
<h5>Security Matters</h5>
[text]
<h5>[more headings]</h5>
[more text]



无论如何,为什么你在那时使用五级标题?什么

发生在h1到h4?我希望这些可以在使用h5之前嵌套。


哦,其他人可能会在px中添加字体大小不好(tm) - 更好

使用ems或百分比aiui。


-

Michael

mrozatukgatewaydotne t



In any case, why are you using a level five heading at that point? What
happened to h1 to h4? I''d expect these to be nested before a recourse to h5.

Oh, someone else will probably add font sizes in px are bad(tm) - better
to use ems or percentages aiui.

--
Michael
m r o z a t u k g a t e w a y d o t n e t


2005年3月17日星期四,deko写道:
On Thu, 17 Mar 2005, deko wrote:
Firefox不会采用以下font-weight:bold我的
样式表中的指令。在IE中工作正常。

#rightMenuText h5 {
font-weight:bold;
padding-bottom:0px;
padding-top:10px;
margin-bottom:0px;
}
如果您查看 http :http://www.clearpointsystems.com 在FF和IE中你都可以看到差异。


#rightMenuText已经愚蠢地指定了10px的字体大小,并且

在我看来,Moz已经完成了所要求的内容。


如果我在Mozilla或FF中以正常和大胆的重量看10px Arial,

它们看起来几乎相同,因为它们太小而无法辨别

差别很大。他们不需要深入嵌入一些复杂的结构中来看看这个。


如果我将它们设置为合理的大小(我在我的比较中使用了1em

test),正常和粗体之间有明显的区别。

与FF对IE?
Firefox will not take the following "font-weight:bold" directive in my
stylesheet. Works fine in IE.

#rightMenuText h5 {
font-weight:bold;
padding-bottom:0px;
padding-top: 10px;
margin-bottom:0px;
}

If you view http://www.clearpointsystems.com in both FF and IE you
can see difference.
#rightMenuText has idiotically specified a font size of 10px, and
it seems to me that Moz has done just what was asked.

If I look at 10px Arial in normal and bold weight in Mozilla or FF,
they look almost same, because they''re too tiny to be able to discern
much difference. They don''t need to be embedded deep in some complex
structure of divs to see this.

If I would set them a sensible size (I used 1em in my comparison
test), there''s a clear difference between normal and bold.
with FF vs. IE?




您能否解释IE在确定此文本大小时的逻辑?

也许我错过了什么。



Can you explain IE''s logic in determining the size of this text?
Maybe I''m missing something.

这篇关于为什么stylesheet指令不适用于FireFox?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆