问题描述
这里是故事:我正在使用SWFObject将Flash对象插入到我的页面中.嵌入吞噬了我的span
.因此,我为此失去了所有CSS.我当时正在考虑将所有CSS移到父级,这样在Flash出现时我就不会丢失CSS样式.
Here is the story: I'm using SWFObject to insert a Flash object into my page. The embedding eats my span
. So, I lose all my CSS for it. I was thinking of moving all of the CSS to the parent so I don't lose my CSS styles when the Flash appears.
我尝试在span
中使用span
,但是我认为它不起作用.是否有一个原因?我不明白为什么您可以在div
中包含div
,但不能在span
中包含span
.
I have tried using a span
within a span
, but I don't think it's working. Is there a reason for this? I don't understand why you could have div
within a div
but not a span
within a span
.
是否与spans
内联有关?
推荐答案
HTML4规范指出:
Span是一个内联元素,因此在span内具有span是有效的.有一个相关的问题:可以< span>标签里面有任何类型的标签吗?这样就可以完全清楚了.
Span is an inline element, therefore having span inside span is valid.There's a related question: Can <span> tags have any type of tags inside them? which makes it completely clear.
HTML5规范(包括11月16日发布的 HTML 5.3 的最新草案. 2017)更改了术语,但将跨度放在另一个跨度中仍然是完全有效的.
HTML5 specification (including the most current draft of HTML 5.3 dated November 16, 2017) changes terminology, but it's still perfectly valid to place span inside another span.
这篇关于您可以有一个< span>吗?在< span>之内?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!