CSS highly adaptive

Source: Internet
Author: User

Related onlineArticle, But none of them talk about ideas. I had this idea before, but I didn't write similar things myself. This time I made such a similar things. We can find that you can do it without looking at it.

After your own attempts, we found that there are two prerequisites:

1. This highly adaptive element is assumed to be a. It must have one or more sibling elements (nodes) and B;

2. Height (B)> height ().

If the above conditions are not met, there is no need for self-adaptation.

There are two things to do:

1. For the parent element (node) of A, if it is C, set: overflow-Y: hidden; // hide the part that may exceed

2. Set "A" to "margin-bottom:-2000px" and "padding-bottom: 2000px". // you can see that the calculated mode in the box mode is exactly offset by each other.

In this way, we can see the effect.

However, I found a problem:

1. in IE6, I used margin-left:-100% for layout. After using this attribute, I found that the location was incorrect and ran out of the screen. Corrected to: _ margin-left:-xxxpx; // The width of the main content of XXX.

Specific reference: http://www.positioniseverything.net/articles/onetruelayout/equalheight or Google: CSS adaptive height

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.