Differentiation of elements in web Front-end HTML and web Front-end html

Source: Internet
Author: User

Differentiation of elements in web Front-end HTML and web Front-end html

As front-end personnel, we need to deal with various hypertext tags and use different tag elements. When I use it, I wonder if I have noticed their category ownership? Let's talk about the opinions of bloggers:

At present, bloggers have summarized three classification methods: one is to divide by closed, the other is to divide by display content, and the other is to divide by document flow.

1. Closed tags can be divided into dual tags and single tags.

Double tags are closed tags. We often write 2. Container-level labels and text-level labels can be divided by display content.

Text-level labels can only contain text, images, links, and so on, such as <p>, <a>, <em>, and <B>. Container-level labels can be used in labels, such as <div>, <li>, 3. file-based streams can be divided into block-level labels and row-level labels.

Not very easy to understand. Let's talk about their characteristics first.

Block-level elements have the following features:

① It always starts on a new line and occupies a whole line;

② Height, row height, and outer and inner margins can be controlled;

③ The bandwidth is always the same as the browser width and has nothing to do with the content;

④ It can accommodate inline elements and other block elements.

Features of In-row Elements:

① And other elements are on one row;

② High, the row height, outer margin, and inner margin can be changed;

③ The width is only related to the content;

④ In-row elements can only contain text or other in-row elements.

Common block-level labels include <div>,

Block-level labels and row-level labels can be converted by setting different values using the display attribute,

Display: block; convert to block element; display: inline; convert to line element, while display: inline-block; convert to line block element.

All text labels are intra-Row labels, and all container-level labels are block-level labels.

Note that<P> label, which is both a text label and a block-level label

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.