CSS height

The height property in CSS specifies the height of an element. It can be set in different units such as pixels, percentages, or even viewport height.

Here's an example of how the height property works:

Result:

    .box {
      height: 100px;
      width: 100px;
      background-color: lightblue;
    }
  

In the example above, a .box class is defined with a height of 100 pixels. This will make the box element 100 pixels tall.

It's important to note that when using the height property, the element must have a specific height value set in order for it to take effect. If the content inside the element is taller than the specified height, it may overflow and not be visible.

Here's another example using percentage values:

Result:

    .container {
      height: 50%;
      width: 200px;
      background-color: lightgreen;
    }
    .content {
      height: 100%;
      background-color: lightpink;
    }
  

In this example, the .container element has a height of 50%. The .content element inside the container has a height of 100%, which means it will take up the full height of its parent element.

Experiment with different values for the height property to achieve the desired layout for your elements.