CSS Flexbox is an awesome tool to create website layouts. Making a flex-box child 100% height of their parent can be done in two ways. It is little tricky because, certainly it will display an error.
For example, the child may flow out of the parent boundary or it may not get upto 100% height that you will see in your browser output.
Example 1: This example makes a child flex-box of height 100% using CSS.
Example 2: The second way to achieve this by using align-items property in the parent div to ‘strech’. It makes every .child-div 100% height of it’s parent height.
Example 3: This example makes width of child to 100% of there parent.
- How to vertically align text inside a flexbox using CSS?
- How to set flexbox having unequal width of elements using CSS ?
- How to align flexbox columns left and right using CSS ?
- Advance CSS layout with flexbox
- HTML width/height Attribute vs CSS width/height Property
- Flexbox utilities in bootstrap with examples
- How to vertically and horizontally align flexbox to center ?
- How to set space between the flexbox ?
- What are the differences between flex-basis and width in Flexbox ?
- How to place content under fixed flexbox navigation bar ?
- How to give a div tag 100% height of the browser window using CSS
- How to make div height expand with its content using CSS ?
- How to select all children of an element except the last child using CSS?
- How to apply style to parent if it has child with CSS?
- How to place two div side-by-side of the same height using CSS?
- How to remove parent element except its child element using jQuery ?
- How to get position of an element relative to the document or parent using jQuery ?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.