您可以使用< span>在< span&gt ;?内 [英] Can you have <span> within <span>?

查看:378
本文介绍了您可以使用< span>在< span&gt ;?内的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里是故事:我使用SWFObject插入一个Flash对象到我的页面。嵌入使用我的 span 。所以,我失去了所有的CSS。我正在想把所有的CSS移动到父,所以我不会失去我的CSS样式时,Flash出现。



我已尝试在 span 内使用 span ,但我不认为它的工作。有什么原因吗?我不明白为什么你可以在 div 中有 div ,但不是 / code>在 span 内。



/

/TR/html401/struct/global.html#h-7.5.3\"> HTML4规范说明:


内联元素只能包含数据和其他内联元素


Span是一个内联元素,因此跨度跨度内有效。
有一个相关问题:可以& span>



HTML5规范更改元素的术语和分类,但您可以看到它仍然可以将span放在另一个span中。


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.

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.

Does it have to do with spans being inline?

解决方案

HTML4 specification states that:

Inline elements may contain only data and other inline elements

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 specification changes terminology and classification for elements, but you can see that it's still valid to place span inside another span.

这篇关于您可以使用&lt; span&gt;在&lt; span&gt ;?内的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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