Web page height self-adapting problem

Source: Internet
Author: User

Objective: To achieve a high level of consistency between the left and right sides

Problem: Under each browser, use jquery to get a high-level problem

Today, using jquery (1.11.1) to get the height of the left and right sides, and to set the height to the height of the top, but halfway to find that when there is a picture in the content area, the height of the load only recognizes the height of the text area. Using Google Chrome (version 35.0.1916.153) testing, it was found that the height would be recognized as long as the image was set to a fixed height, and would not be recognized if no settings were set. Change IE9 Browser test, is able to identify the height of the normal.

Because I have this recognition height is mainly used to set the left sidebar has a background color, and set the height and the right content area of the same height. Later thought JS may appear incompatible problems, so use the middle of the entire large frame (red box) set the background color, and then set the right background to white to achieve.

Here are two questions to summarize:

1.js in each browser compatibility issues, so as far as possible without JS to achieve.

2. Sometimes a very simple rough way may solve the problem, CSS is a very good thing.

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.