The difference between the span element and the div element.

Source: Internet
Author: User

The difference between the span element and the div element.

Differences between span elements and div elements:
This section briefly introduces the differences between the span element and the div element. Because these two elements are very common in layout, it can be said that almost no page is applicable to these two elements, the following describes the main differences between the two.
I. Attributes of elements:
The span element is an inline element, while the div element is a block-level element.
For more information about the differences between the two types of elements, see section 1 "What are block-level elements and inline elements.
Ii. Usage of elements:
The div element is mainly used for a large frame layout, while the span element is mainly used for content modification, such as the color font size.
The Code is as follows:

 

<! DOCTYPE html>  

 

The above code is just a simple demonstration, that is, div is responsible for the large layout, while the span element focuses on the details.

The original address is: http://www.softwhy.com/forum.php? Mod = viewthread & tid = 13064.

For more information, see: http://www.softwhy.com/divcss/

 

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.