CSS Height

CSS height property is used to set height of the content area of an element.

  • The height of an element does not include padding, borders, margins.
  • The min-height and max-height properties override height.

Height Syntax

height: value [auto | lenght | initial | inherit];
                                

CSS Height: Parameters

  • length: Defines the height absolute value
  • fixed: Defines the height fixed value in pixels, em, etc.
  • percentage: Defines the height value in percentage
  • auto: The browser will calculate the height for the element
  • inherit: Element will inherit the height from its parent element

Example: Height Auto

.div_1 {
     border: 1px solid green;
     height: auto;
  }

Output

height: auto

CSS (Cascading Style Sheets) is very easy in comparison to other web technology. You just have to understand the basic CSS in deep, it is a one-time investment process that means if you will completely understand about CSS from basic level then you will not forget it in your entire life.

Example: Height 100px

.div_1 {
     border: 1px solid green;
     height: 100px;
  }

Output

height: 100px

CSS (Cascading Style Sheets) is very easy in comparison to other web technology. You just have to understand the basic CSS in deep, it is a one-time investment process that means if you will completely understand about CSS from basic level then you will not forget it in your entire life.




Example: Child & Parent Element

#parent {
     border: 1px solid green;
     height: 100px;
     width: 300px;
  }
#child {
     border: 1px solid pink;
     height: 50%px;
     width: 75%;
  }

Output

This is a height description

Policy

GDATAMART.COM is optimized for learning & job information; The users try to improve your knowledge and practical experience through this site but we cannot warrant full correctness of all content... Learn More → | Sitemap →

© 2020 GDATAMART | All Rights Reserved