HTML Tag Element classification (Basic HTML knowledge) and basic tag knowledge

Source: Internet
Author: User

HTML Tag Element classification (Basic HTML knowledge) and basic tag knowledge
HTML Tag elements are classified as block-level elements. 0. block-level elements and inline-level elements are classified as "inline" elements ). A. block-level elements (exclusive rows) block elements, the most obvious feature is that it is in the content area that is filled with its parent element horizontally by default, and there are no other elements on its left and right sides, that is, block-level elements occupy only one row by default. Typical block-level elements include: <div>, <p>, *Differences between block-level elements and intra-row elements:(1) A block-level element occupies only one row, and its width automatically fills the width of its parent element. An element in a row does not occupy only one row, and elements in an adjacent row are arranged in the same row, the width of a block-level element varies with the content of the element. (2) In general, the width and height attributes can be set for block-level elements. The width and height attributes of the element in the row are invalid. (3) You can set margin and padding for block-level elements. the horizontal orientation of the row elements, such as padding-left, padding-right, margin-left, and margin-right, all produce margin effects, but the vertical orientation includes padding-top, padding-bottom, neither margin-top nor margin-bottom produces any margin effect. (Valid in the horizontal direction, invalid in the vertical direction ). 1. Replace and unreplaceable elements, of course, can be divided by block-level and intra-row elements, or whether they can be replaced. A. Replace element (this element can produce different display effects based on a property change) the replacement element is used by the browser to determine the specific display content of the element based on the tag and attribute of the element. For example, the browser reads and displays the image information based on the value of the src attribute of the label. If you view (X) HTML code, you cannot see the actual content of the image; for example, the type attribute of the <input> label determines whether to display the input box or single-choice button. (X) , <input>, <textarea>, <select>, and <object> in HTML are all replacement elements. These elements often have no actual content, that is, an empty Element B. Most elements of element (X) HTML cannot be replaced, that is, their content is directly presented to the user end.Special: Generally, it is useless to set the width and height of an element in a row. Why can I set the width and height of an element in a row, such as input or img? Because input, img, and so on are all replacement elements, the replacement element has a general internal size, so it has width and height, which can be set, it is special. When we do not set their width and height, the browser will give the default width and height. For example, <input type = "text"> the default width and height are displayed in the input text box. But we can change its width and height.

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.