Multiple divs are distributed at the same interval in the same row, and multiple divs are separated.

Source: Internet
Author: User

Multiple divs are distributed at the same interval in the same row, and multiple divs are separated.

Multiple divs are distributed at the same interval in the same row:
This layout effect is frequently used, that is, multiple divs are distributed in one row, and the gap between divs is the same. It is often used for product display, the following describes how to implement the layout. The code example is as follows:

<! DOCTYPE html> 

The above Code meets our requirements. The li element can be evenly distributed in the div, and the interval between them is the same.
The principle is very simple, that is, let li float left, then set the margin-right attribute value, that is, the interval between li elements, and the div element has the overflow: hidden attribute, in this way, the part beyond the margin-right is hidden, so that there is no blank on the right side.

Original address: http://www.51texiao.cn/HTML5jiaocheng/2015/0521/2134.html

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.