Monday, June 6, 2022
HomeWordPress DevelopmentThe best way to make an empty div take house ?

The best way to make an empty div take house ?


Enhance Article

Save Article

Like Article

On this article, we are going to learn to make an empty div take house utilizing CSS.

Method: The answer is to offer some peak (or min-height) and width (or min-width) to your HTML div. While you set a selected peak and width for a div, it doesn’t matter whether it is empty or overflowed, it should solely take up the house as given within the code.

Instance: Within the following code, the empty house is achieved by giving a peak of 200px and a width of 400px.

HTML

<!DOCTYPE html>

<html>

<head>

    <type>

        .field{

          width: 400px;

          peak: 200px;

          border: 2px black stable;

        }

    </type>

</head>

  

<physique>

   <h2 type="coloration:inexperienced">GeeksforGeeks</h2>

   <b>

<p>Empty house round div</p>

</b><br/>

   <div class="field"></div>

</physique>

</html>

Output:       

 

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments