Non-replacement element and replacement element.

Source: Internet
Author: User

Non-replacement element and replacement element.

Learning Materials: http://www.cnblogs.com/wkylin/archive/2011/05/12/2044328.html

Elements are the basis of the document structure. In css, each element generates a box containing content, which is called a box ". However, different elements are displayed in different ways. Each element occupies a whole row, and each element occupies a single row. For example, the div and span methods are different.

What are replacement elements and non-replacement elements?

Replacement element:

The replacement element is used by the browser to determine whether to display the specific content based on the elements and attributes of the tag.

For example, for <input/> type = "text", this is a text input box. When it is changed to another one, the browser displays different results.

(X) in HTML, , <input>, <textarea>, <select>, and <object> are all replacement elements, and none of these elements have actual content.

Non-replacement element:

(X) Most HTML elements are irreplaceable. They directly tell the browser about the content and display it.

For example, <p> wanmei.com </p>

The browser will display the content directly.

In addition to the two words, there are two very attribute elements, the display element, which is divided into two situations, one is the 'block and the element 'block ', another type is "inline element", which is also called "inline element ".

Blocks and elements

His most obvious characteristic is that he occupies a single row and automatically fills the content area of the parent element. He will never let others "invade" (of course, he can be changed in other ways ).

Common examples are: div, p... and so on.

Float (float attribute, float left or right) and display (display) are set through CSS) all the elements whose attributes are "block" or "list-item" are block-level elements. Floating here is a special case. You can check the floating knowledge in detail.

Line element:

As mentioned above, the block and element occupy a row by themselves, and the element in the row is not so overbearing. They can allow both the left and right elements. The most common one is <a> </a>.

After you set it through display: 'inline', it will become a row element.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.