About the HTML front-end setting of an adaptive height div problem

Source: Internet
Author: User

If you want to set the div adaptive height, we can adopt height:auto; This property, but this property IE6 is not supported. Does it have a headache? In fact, it is not difficult to solve this problem, but also a lot of methods, here is recommended a: (assuming we need to control the div minimum height is 100px, more than let the information inside automatically open):

    1. . div{
    2. Height:auto!important;
    3. Height:100px;
    4. Min-height:100px;
    5. }


Note: Because!important in IE7 and Firefox can read, and the weight is higher than the back of the height:100px, so when the IE7 and Firefox display, will use the previous height:auto!important; And IE6 can not recognize!important,auto to it, so it will apply the style of the following height:100px, and min-height:100px that the div minimum height is 100px; This property is recognized in both IE7 and Firefox.

Excerpt from: http://www.phpshuo.com/show/13_40.html

About the HTML front-end setting of an adaptive height div problem

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.