Block Element (div) and inline element (span), inline span

Source: Internet
Author: User

Block Element (div) and inline element (span), inline span

<Pre class = "html" name = "code"> 




What do inline and block elements in css mean respectively?

Here is an example of inline elements of block elements.

Div Block Element
Span inline Element
--------------------------------
<Div> block element </div>
<Span> I am inline element 1 </span>
<Span> I am an inline element 2 </span>
------------------------
Running, we can find that div occupies two or more columns of a single row and span can occupy one row.
-----------------------------------------------------------
The display attribute means that the display itself has many attributes,
---------------------------------------------
A simple explanation. Next, you can go to the next CSS Reference Manual on the Internet to see the detailed explanation.

Div: How do block and inline elements convert each other?

<Div style = "display: inline"> change block elements to inline elements </div> <span style = "display: block"> change inline elements to block elements </span>

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.