Whitespace causes horizontal spacing of elements in rows

Source: Internet
Author: User

When the test block-level element differs from the in-line element, it is found that there should be no interval between the horizontal elements in the row within the line element.

1 <span>In-line elements</span>2 <span>In-line elements</span>3 <span>In-line elements</span>4 <span>In-line elements</span >

Effects such as:

This problem occurs because of the space between the span notes in the HTML. If you remove the space then there will be no spacing.

< span > inline elements </span><span> inline elements </ span >< span > inline elements </span>

Effects such as:

Although the problem is found, if there are multiple inline elements, the code squeeze on one line will cause reading difficulties, how to do?

Expand Reading : 1. "original" inline elements create a horizontal void is a bug?-Gondor-Blog Park

Http://www.cnblogs.com/PeunZhang/archive/2012/09/28/2706094.html

2. Http://davidwalsh.name/remove-whitespace-inline-block

Through the Internet search data, found that "the spacing between the elements of the line, is due to line breaks, tab (tab), space and other characters caused, and the size of the character is defined font size to control ", so the removal interval can change the size of the font start. That is font-size:0, but the specific use of the corresponding adjustment, not necessarily a value of 0.

Whitespace causes horizontal spacing of elements in rows

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.