如何显示< div>元素在< span>中?

如何显示< div>元素在< span>中?

问题描述:

我的容器元素是< span> ,我想在内部显示< div> 元素它。如何在< span> 内添加< div> < div> display:inline;

My container element is a <span> and I want to display a <div> element inside it. How can I add a <div> inside a <span> without making the <div> display: inline;?

<span>
    <div>Content goes here</div>
</span>


将范围更改为显示块?
但是它根本没有意义,如果你需要一个块,然后用一个div替换span。
您的文档不会以这种方式进行验证,而且在不同浏览器中的行为有点难以预测......

Change the span to display block? But it makes no sense at all, if you need a block inside, then replace the span with a div. Your document won't validate this way either and behavior in different browsers is kinda unpredictable...