Overflow and height calculation of elements in HTML

Source: Internet
Author: User
  1. Everyone knows that blocks and inline-block elements such as height=contentheight at least in Firefox, but if a block-level element is not set to Height, then the element's height= ( The size of the child element (Content+padding+margin)), but the element with the positional attributes (fixed and absolute) and the float element is not within the above calculation range, but there is also a positional property-relative, If you specify the top property of the relative element, such as style= ' top:10px;position:relatve;height:90px ', the height of the unspecified parent element is equal to 90px (excluding the Top property, That is, the height of the child element box model), so that it seems that relatively positioned elements can go beyond the boundaries of the parent element, which is no problem.
  2. For overflow, as long as the non-absolute positioning and fixed positioning elements, if set Overflow=scroll, then the above relative elements can be considered out of bounds, you will see a vertical scroll bar, for more general situation, do not elaborate.
  3. Afraid to forget, record it again

Overflow and height calculation of elements in HTML

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.