Float:left and span tags for div

Source: Internet
Author: User
I'm a divspanspan

The div in the above code is float:left,span without float:left, but the span tag is still displayed on the right side of the DIV tag instead of being overwritten by a DIV tag. This is because the span tag is an inline element and not a block-level element.

? Next attach them both
The difference:

Div and Span differences

The difference is, div? is a block-level (Block-level) element, the element that surrounds it wraps automatically. Span is simply an inline element that does not wrap around it. There is no structural meaning, it is purely an applied style, and the elements can be used when other inline elements are not appropriate. Note that a tag can be contained within a tag, become his child element, and vice versa, that is , the tag cannot contain a tag

The above describes the div float:left and span tags, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • 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.