We have studied the highly adaptive problem of Div + CSS.

Source: Internet
Author: User

Div + CSS is still relatively difficult to implement. It is difficult to achieve the adaptive height of the upper and lower Divs. I checked the information and found that only the upper and lower heights are hundreds of ratios, I want to implement the above Div as the specific pixel height. below is the adaptive ratio of the remaining parts. I have to use JavaScript for a moment. I don't know if it's stupid. Please post a good method.
<Body style = "Height: 100%; margin: 0px; width: 100%;">
<Div id = "ddii22" style = "background-color: # ffffff; Height: 110px; position: absolute; left: 0px; top: 0px; width: 100%; z-index: 1000 ">
1111111111111111
</Div>
<Div id = "ddii" style = "background-color: #999999; Height: 100%; position: absolute; left: 0px; top: 110px; width: 100%; z-index: 100 ">
<Div style = "height: 100%; overflow: auto;">
</Div>
</Div>
<SCRIPT type = "text/JavaScript">
Document. getelementbyid ('ddii '). style. Height = Document. getelementbyid ('ddii'). clientHeight-110 + 'px ';
</SCRIPT>
</Body>

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.