Two columns, high layout, padding + margin, negative CSS, layout, odd tricks-multiple columns, high height, paddingmargin

Source: Internet
Author: User

Two columns, high layout, padding + margin, negative CSS, layout, odd tricks-multiple columns, high height, paddingmargin

Code:

:


Passerby A: OK? High ??

Passerby C: Isn't it?

Passerby B: Are you kidding me?


Xiaomogg:

The effect is a bit miserable, but this is indeed a high-performance solution.

Why does it look not high?

Pay attention to the red box in the code

Padding-bottom: 99px;
Margin-bottom:-99px;


Lu renjia: this does not explain any problems !!

Passerby B: Enter the topic.

Passers-by C :......................


Xiaomogg:

In fact, "high" is really not high

1. if you set the value of padding-bottom: 99px; margin-bottom:-99px; to a greater value, for example, padding-bottom: 999px; margin-bottom:-999px, at the same time, you can add overflow: hidden to the outermost layers of the two columns to see the "height ".

2. In fact, if the negative value of margin and the value of padding are not added in the above example, overflow: hidden is given to the outermost layer in time, and the effect is still as follows:

3. Let's take a look at the first step.


"Climb" on both sides, and there is nothing on the right side in time, but this is just a "blind eye"


① Remove overflow from the outermost layer: hidden;

② If the height of the content filled in either of the two columns is greater than 999, the height will be displayed.

③ "" And "". If csss is used alone, it is just a coincidence or a "blind eye". If the above two situations or unknown situations occur, "Climb"

Is exposed to the eyes

④ If you can limit the content height of two columns, you can try to use the pure css layout




The above results have been tested and support IE7 Google Firefox



Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.