CSS layout of the product word layout

Source: Internet
Author: User

Recently, some students interviewed were asked about the layout of the product word. Although I think this layout is really ugly, it should not be used, but since someone asked, I still try to write the word layout. It's actually very simple.

First look at the effect:

The first type:

The second type:

The first type:

In fact, the implementation method is very simple, the basic idea:

(1) Three blocks of aspect are determined;

(2) above that block with margin:0 Auto;

(3) The following two block with float or inline-block do not change;

(4) Adjust the position with margin to center them.

The inline method code is as follows:

<! Doctype html>

Here first use margin-left:50%, let the following two block left to the middle position. And then to the lower right corner of the block with Margin-left, the value is negative twice times the width. You can move it to the lower left corner. So the second div is lower right, the third one is lower left and needs to be changed.

There is also a small trick, using Inline-block will have a small gap, you can use to remove the spacing between inline-block elements of n methods to solve.

Float mode:

<! Doctype html>

and inline-block the same way, we will not repeat.

There are full-screen product word layout, it is more simple, the basic idea is the above div width 100%, the following two div width 50%, and then use float or inline so that it does not change the line.

Here's a way to put it:

<! Doctype html>


CSS layout of the product word layout

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.