替换元素(replaced element)与非替换元素(non-replaced element)
来源:互联网 发布:时间轴页面源码 编辑:程序博客网 时间:2024/06/06 16:55
以下是摘自W3C官网的解释,请参考原文:http://www.w3.org/TR/CSS21/conform.html
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.
所谓替换元素(replaced element),就是元素本身没有实际内容,最终显示内容需要浏览器根据元素某些属性去判断的元素。
如<img>元素,其最终的显示内容是由属性src决定的,如<input>元素,其最终显示的效果是由属性type决定的。
常见的替换元素还包括:<textarea>、<select>、<object>。
替换元素经常具备固有的尺寸:固有的width,固有的height,以及固有的比例ratio。
这个理解起来不难,类比<img>元素,它的固有尺寸就是原始图片大小;类比<input>元素,不管其type属于哪一种类型,显示出来的input元素都有原始尺寸。
但是像<div></div>这样的非替换元素,其没有固有尺寸。
HTML中大多数是非替换元素(non-replaced element)。
所谓非替换元素和替换元素相反,元素本身是有实际内容的,浏览器会直接将其内容显示出来,而不需要根据元素属性来判断到底显示什么内容。如<span>this is the content</span>,元素内容就是“this is the content”。
- 替换元素(replaced element)与非替换元素(non-replaced element)
- css 替换元素 replaced element
- css可替换元素(replaced element)
- replaced element / non-replaced element : 内容决定
- replaced element解释
- replaced element ,input,select
- CSS:替换元素(Replaced)、不可替换元素(Nonreplaced)、块元素(Block-level)和行内/内联元素(Inline)
- 替换元素与非替换元素
- 替换元素与非替换元素
- 替换元素与非替换元素
- 什么是替换元素与非替换元素
- Replaced Elements(可置换元素)
- HTML + CSS 之替换元素与非替换元素
- css 非替换元素和替换元素
- 非替换元素和替换元素
- CSS 替换元素和非替换元素
- 非替换元素和替换元素
- 非替换元素和替换元素
- 线程——现代操作系统学习笔记
- java中两数的四则运算
- java调用ffmpeg转换视频格式为flv
- cisco 配置文件和基本命令
- Tomcat启动时提示Exception loading sessions from persistent storage错误
- 替换元素(replaced element)与非替换元素(non-replaced element)
- POJ 3420
- X230安装10.9.3黑苹果不完美教程
- SAS学习笔记之输出到Excel
- CentOs 6.3_64静默安装oracle11g_r2
- 多进程间通信之信号中断处理
- Android编译后的目录结构
- 二叉树中两个节点的最近公共父节点
- 字符串匹配——Brute-Force 简单匹配算法