HTML5:非替换元素与替换元素? [英] HTML5: Non-replaced vs. replaced element?

查看:97
本文介绍了HTML5:非替换元素与替换元素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到第10.3节HTML5规范中的非替换元素。我能够通过Google找到定义,但W3C HTML5定义中的非替换元素和替换元素的定义在哪里?解析方案

CSS2.1规范


替换的元素



元素的内容超出CSS格式模型的范围,如图像,嵌入式文档或小程序。例如,对于
,HTML IMG元素的内容通常被其src属性指定的
图片取代。替换的元素通常
具有固有的尺寸:固有宽度,固有高度,
和固有比率。例如,位图图像具有固有的
宽度和以绝对单位指定的固有高度(从中明显可以确定固有比率
)。另一方面,
其他文档可能没有任何内部维度(例如,
空白HTML文档)。

用户代理可能会考虑如果认为这些维度可能会将敏感信息泄露给第三方,那么替换的元素不具有任何固有维度。例如,如果一个HTML
文档根据用户的银行余额改变了内部大小,那么UA可能希望这个资源没有固有的
维度。



替换元素的内容在CSS渲染模型中不予考虑。



I see section 10.3 Non-replaced elements in the HTML5 spec. I was able to find the definition via Google, but where's the W3C HTML5 definition for non-replaced vs. replaced elements?

解决方案

From the CSS2.1 spec:

Replaced Element

An element whose content is outside the scope of the CSS formatting model, such as an image, embedded document, or applet. For example, the content of the HTML IMG element is often replaced by the image that its "src" attribute designates. Replaced elements often have intrinsic dimensions: an intrinsic width, an intrinsic height, and an intrinsic ratio. For example, a bitmap image has an intrinsic width and an intrinsic height specified in absolute units (from which the intrinsic ratio can obviously be determined). On the other hand, other documents may not have any intrinsic dimensions (for example, a blank HTML document).

User agents may consider a replaced element to not have any intrinsic dimensions if it is believed that those dimensions could leak sensitive information to a third party. For example, if an HTML document changed intrinsic size depending on the user's bank balance, then the UA might want to act as if that resource had no intrinsic dimensions.

The content of replaced elements is not considered in the CSS rendering model.

这篇关于HTML5:非替换元素与替换元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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