CSS和Firefox [英] CSS and Firefox
问题描述
你好。
快速提问 - 如果它在错误的地方请指出我的方向
方向。
Firefox / Opera等识别CSS类如:
body#page1#tab1 {
}
即匹配< body id =" page1">< div =" tab1">< / div>< / body>
我的课程在IE中运行良好,而在Firefox / Opera中根本没有 - 这是一个已知的问题,是否有解决办法?或者我只是很厚?
ta
marc
Hello.
Quick question - if its in the wrong place please point me in the right
direction.
Does Firefox / Opera etc recognise CSS classes such as:
body#page1 #tab1{
}
i.e to match <body id="page1"><div ="tab1"></div></body>
My classes work fine in IE and not at all in Firefox / Opera - is this
a known issue and is there a work-around? or am i just being thick?
ta
marc
推荐答案
marc.birk ... @ gmail.com写道:
marc.birk...@gmail.com wrote:
Firefox / Opera等识别CSS类如:
Does Firefox / Opera etc recognise CSS classes such as:
浏览器有效。你的代码坏了。
"#"表示一个id,而不是一个类。
"< div =" tab1">"什么都没有用。
为什么你需要用id来识别身体元素?
为什么你需要身体CSS选择器呢?除非你实际上将页面画布作为< body>来处理
本身,然后
无论如何,来自身体的亲子关系隐含在所有HTML元素中。
这是罕见的(尽管有时需要,并且始终有效)带有嵌套ID的CSS
选择器。 ID是唯一的,HTML是树形的
(即文档中任何位置只有一条路径) - 那么为什么你需要选择
组合两个ID,而不仅仅是一个?
在IE中工作几乎是一个无效器,当然不是验证器。
这个页面是什么样的喜欢?发布网址,而不是片段。
The browsers work. Your code is broken.
"#" indicates an id, not a class.
"<div ="tab1">" isn''t valid anything.
Why do you need to identify the body element with an id?
Why would you need body in the CSS selector at all ? Unless you''re
actually addressing the page canvas as the <body> itself, then
parentage from body is implicit in all HTML elements anyway.
It''s rare (albeit sometimes needed, and always valid) to have a CSS
selector with nested ids. ids are unique and HTML is tree-structured
(i.e. only one path to any location in the document) - so why would you
ever need to select on the combination of two ids, not just on one ?
Working in IE is almost an invalidator, certainly not a validator.
What does this page look like? Post a URL, not a fragment.
ma ********** @ gmail.com 写道:
你好。
快速提问 - 如果它在错误的地方请指向我正确的方向。
Firefox / Opera等识别CSS类如:
body#page1#tab1 {
}
即匹配< body id =" page1">< div =" tab1">< / div>< / body>
<我的课程在IE中运行良好,而在Firefox / Opera中根本没有 - 这是一个已知的问题,是否有解决方法?或者我只是厚吗?
Hello.
Quick question - if its in the wrong place please point me in the right
direction.
Does Firefox / Opera etc recognise CSS classes such as:
body#page1 #tab1{
}
i.e to match <body id="page1"><div ="tab1"></div></body>
My classes work fine in IE and not at all in Firefox / Opera - is this
a known issue and is there a work-around? or am i just being thick?
很难想象IE会如何识别< div =" tab1"> ;.
It''s hard to imagine how even IE would recognize <div ="tab1">.
di*****@codesmiths.com 写道:
marc.birk ... @ gmail.com写道:
marc.birk...@gmail.com wrote:
Firefox / Opera等识别CSS类如:
Does Firefox / Opera etc recognise CSS classes such as:
浏览器有效。你的代码坏了。
"#"表示一个id,而不是一个类。
"< div =" tab1">"什么都没有用。
为什么你需要识别带有id的body元素?
The browsers work. Your code is broken.
"#" indicates an id, not a class.
"<div ="tab1">" isn''t valid anything.
Why do you need to identify the body element with an id?
至少有一种技术这涉及到一个页面分配一个ID。
也可以使用一个类,但由于主体的定义是唯一的,因此在CSS中给出了更高的特性比起课程,使用ID会感觉很好。
There is at least one technique that involves assigning an ID to a page.
A class could be used too, but since the body is unique by definition,
and since IDs are given higher specificity in CSS than classes, it makes
sense to use an ID.
这篇关于CSS和Firefox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!