CSS (The Four)

Source: Internet
Author: User

The core of CSS: floating, box model, positioning

Div is a block-level element, with each div occupying one line.

Block element Features: 1. The default is displayed in the upper-left corner of the parent tag; 2. The accounting element fills the line by default (full document flow)

Common block-level elements: P, H1-H6, ul Li, Ol Li, Div, table, HR, etc.

Corresponds to the inline element (inline Element): A, span, IMG, input, etc.

Features of inline elements: 1. The size is affected by the text area, not affected by height and width; 2. Does not occupy a single row.

Application of the span tag: does not occupy a single row, and is not affected by other block-level elements

The inline element becomes a block-level element: Display:block;

Block-level element programming inline elements: display:inline;

Display:inline-block; Affected by aspect, does not occupy a single line. (Block-level elements, inline elements are valid)

In order for the two div to be arranged in a row, it needs to be set by a float.

CSS (The Four)

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.