Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML5: Non-replaced vs. replaced element?

Tags:

html

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?

like image 877
ma11hew28 Avatar asked Nov 04 '11 16:11

ma11hew28


People also ask

What is the difference between replaced inline elements and non-replaced inline elements?

There are two types of inline elements: replaced inline elements and non-replaced inline elements. In general, non-replaced elements are those whose content is contained in the document, whereas replaced-elements are those whose content is outside of the document.

What is a replaced element in HTML?

In CSS, a replaced element is an element whose representation is outside the scope of CSS; they're external objects whose representation is independent of the CSS formatting model.

What is Non-replaced element in CSS?

The div and p elements are called non-replaced elements because their content is actually displayed. It is not replaced with something else. Replaced elements - Some HTML elements do not have content in between opening and closing tags. For example: <img src="eightball.gif"> or <input type="reset">

Can the element HTML be replaced with HTML?

HTML replaced elements According to W3C, an HTML replaced element is an element whose content is outside the scope of the CSS formatting model. An example is the HTML img element, whose content is replaced by the image that its src attribute designates. Oh, and the img element is one of the HTML void elements too.


1 Answers

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.

like image 102
steveax Avatar answered Sep 21 '22 18:09

steveax