Getting Started with CSS (4) floating and positioning in--CSS

Source: Internet
Author: User
1 Block-level elements and inline elements

1 Block-level elements

Occupy a row and cannot be tied to any other elements

Can accept wide, high

If you do not set the width, the width defaults to 100% of the father.

2 in-line elements

Alongside other inline elements

cannot be set wide and high. The default width is the width of the text.

In HTML, we have divided the tags into classes, at that time: text-level, container-level.

Text level: P, span, a, B, I, U, EM

Container level: Div, H Series, Li, DT, DD

The classification of CSS is similar to the above, which is different from P:

All text-level tags are inline elements, except that the p,p is a text-level, but a block-level element.

All container-level tags are block-level elements. 2 block-level elements and the reciprocal conversion of inline elements

1 div{

2 display:inline;

3 Background-color:pink;

4 width:500px;

5 height:500px; }

1 span{

2 Display:block;

3 width:200px;

4 height:200px;

5 Background-color:pink; }

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.