相同的样式表,不同的结果 [英] Same Stylesheet, Different Results
问题描述
我有两个页面使用相同的样式表,但只有一个页面产生预期结果
。不一致只发生在资源管理器中,用于
Windows。我试过的所有Mac浏览器,包括用于
Mac的Explorer 5,都能正常工作。
我已粘贴下面的样式表。问题是要将
类的元素置于警告的中心。中心在此页面中正确显示:
http://主页。 mac.com/bsharvy/index.html
但不是这个(或其他类似的):
http://homepage.mac.com/bsharvy/mirage.html
它完全没有意义,因为两者都使用相同的样式表
(mmedia.css)。再一次,问题只发生在Explorer for
Windows。
-
body {color:#33aa33;背景:黑色;}
a {填充:1px;}
a.bright {颜色:#aabb55;}
a:悬停{color:#aaaaff; } / *当鼠标悬停在链接上时* /
..warning {
背景:#333333;
填充:0.5 em;
border:none;
宽度:60%;
margin-left:auto;
margin -right:auto;
}
h1.neutral {color:#aaaaaa;
margin-left:20%;
}
。done {
填充:0.5em;
字体大小:95 %;
背景:#121212;
宽度:自动;
text-align:right;
}
。done a:hover {background:#aaaaff;颜色:#121212;}
I have two pages which use the same stylesheet, but only one produces
the intended result. The inconsistency only happens in Explorer for
Windows. All the Mac browsers I''ve tried, including Explorer 5 for
Mac, work correctly.
I''ve pasted the stylesheet below. The problem is to center elements of
class "warning." The centering happens properly in this page:
http://homepage.mac.com/bsharvy/index.html
but not this one (or others like it):
http://homepage.mac.com/bsharvy/mirage.html
It makes absolutely no sense, since both use the same stylesheet
(mmedia.css). Again, the problem only happens with Explorer for
Windows.
--
body {color: #33aa33; background: black;}
a {padding: 1px;}
a.bright {color: #aabb55;}
a:hover { color: #aaaaff; } /* when mouse is over link */
..warning {
background: #333333;
padding: 0.5em;
border: none;
width: 60%;
margin-left: auto;
margin-right: auto;
}
h1.neutral {color: #aaaaaa;
margin-left:20%;
}
.done {
padding: 0.5em;
font-size: 95%;
background: #121212;
width:auto;
text-align: right;
}
.done a:hover {background: #aaaaff; color: #121212;}
推荐答案
2004年4月7日14:18:43 -0700,Ben Sharvy< bs ***** @ mac.com>写道:
On 7 Apr 2004 14:18:43 -0700, Ben Sharvy <bs*****@mac.com> wrote:
我有两个页面使用相同的样式表,但只有一个页面产生预期的结果。不一致只发生在Windows的资源管理器中。我试过的所有Mac浏览器,包括用于Mac的Explorer 5,都能正常工作。
I have two pages which use the same stylesheet, but only one produces
the intended result. The inconsistency only happens in Explorer for
Windows. All the Mac browsers I''ve tried, including Explorer 5 for
Mac, work correctly.
为错误的文档添加doctype。问题解决了。
Add a doctype to the erroneous document. Problem solved.
2004年4月7日14:18:43 -0700,Ben Sharvy< bs ***** @ mac.com>写道:
On 7 Apr 2004 14:18:43 -0700, Ben Sharvy <bs*****@mac.com> wrote:
我有两个页面使用相同的样式表,但只有一个页面产生预期的结果。不一致只发生在Windows的资源管理器中。我试过的所有Mac浏览器,包括用于Mac的Explorer 5,都能正常工作。
I have two pages which use the same stylesheet, but only one produces
the intended result. The inconsistency only happens in Explorer for
Windows. All the Mac browsers I''ve tried, including Explorer 5 for
Mac, work correctly.
为错误的文档添加doctype。问题解决了。
Add a doctype to the erroneous document. Problem solved.
bs ***** @ mac.com (Ben Sharvy)写道:
bs*****@mac.com (Ben Sharvy) wrote:
我有两个页面使用相同的样式表,但只有一个页面产生了预期的结果。不一致只发生在Windows的资源管理器中。我试过的所有Mac浏览器,包括用于Mac的Explorer 5,都能正常工作。
我已粘贴下面的样式表。问题是将类别警告的元素集中在一起。中心在此页面中正确显示:
http://主页。 mac.com/bsharvy/index.html
但不是这个(或其他类似的):
http://homepage.mac.com/bsharvy/mirage.html
这绝对没有意义,因为两者都使用相同的样式表
(mmedia.css)。同样,问题只发生在Windows的资源管理器中。
I have two pages which use the same stylesheet, but only one produces
the intended result. The inconsistency only happens in Explorer for
Windows. All the Mac browsers I''ve tried, including Explorer 5 for
Mac, work correctly.
I''ve pasted the stylesheet below. The problem is to center elements of
class "warning." The centering happens properly in this page:
http://homepage.mac.com/bsharvy/index.html
but not this one (or others like it):
http://homepage.mac.com/bsharvy/mirage.html
It makes absolutely no sense, since both use the same stylesheet
(mmedia.css). Again, the problem only happens with Explorer for
Windows.
不同的文档类型,(或者说是一个doctype和一个缺少doctype)。
这导致一个页面进入标准模式,一个进入
怪癖模式。 IE6仅支持通过边距居中:auto;在
标准模式。
史蒂夫
-
"我的理论给你,我的异端邪说你愤怒,
我从不回信,你不喜欢我的领带。 - 医生
Steve Pugh< st *** @ pugh.net> < http://steve.pugh.net/>
Different doctypes, (or rather one doctype and one lack of doctype).
This causes one page to go into Standards mode and one to go into
Quirks mode. IE6 only supports centering via margin: auto; in
Standards mode.
Steve
--
"My theories appal you, my heresies outrage you,
I never answer letters and you don''t like my tie." - The Doctor
Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
这篇关于相同的样式表,不同的结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!