做< span>具有“position:absolute”的元素;表现为块级元素? [英] Do <span> elements with "position: absolute;" behave as block-level elements?
问题描述
它似乎可行,但所有浏览器都可以省略 简短回答:是。 长答案:参见 http://www.w3.org/TR/CSS21/visuren.html#dis-pos-flo (或者SLaks的答案)。 Hovewer,这个改变只涉及元素的视觉显示模型。 CSS不能影响HTML元素的内容模型因为只有在将文档解析为DOM树后才应用CSS。因此 Are It seems to work, but is it ok with all browsers to omit Short answer: yes. Long answer: see http://www.w3.org/TR/CSS21/visuren.html#dis-pos-flo (or SLaks's answer). Hovewer, this change refers only to the visual display model of the element. The CSS can't affect the content model of the HTML element since CSS is applied only after the document is parsed into DOM tree. So 这篇关于做< span>具有“position:absolute”的元素;表现为块级元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! position:absolute;
能够拥有高度,宽度,无需将其更改为 display:block;
或 inline-block;
?
display:block / inline-block
for < span>
元素与 position:absolute;
?
span
元素永远不能有 p
或 div
不管哪种款式适用于它。<span>
elements with position: absolute;
able to have a height, width, padding, etc. without changing it to display: block;
or inline-block;
? display: block/inline-block
for a <span>
element with position: absolute;
?span
element can never have p
or div
children, no matter which styles are applied to it.