Skip to content
Related Articles

Related Articles

Improve Article

HTML | Screen height Property

  • Last Updated : 26 Jul, 2019

The Screen height property is used for returning the total height of a user’s screen. It returns the total height of the screen in pixels.

Syntax:

screen.height

Below program illustrates the Screen height Property :

Checking the total height of a user’s screen.




<!DOCTYPE html>
<html>
  
<head>
    <title>
      Screen height Property in HTML
    </title>
    <style>
        h1 {
            color: green;
        }
          
        h2 {
            font-family: Impact;
        }
          
        body {
            text-align: center;
        }
    </style>
</head>
  
<body>
  
    <h1>GeeksforGeeks</h1>
    <h2>Screen height Property</h2>
  
    <p>
      For checking the screen's total height, 
      double click the "Check Height" button: 
    </p>
  
    <button ondblclick="check_height()">
      Check Height
    </button>
  
    <p id="height"></p>
  
    <script>
        function check_height() {
            var h = 
                "Total Screen Height In Pixels : " 
                                + screen.height;
            document.getElementById("height").innerHTML = h;
        }
    </script>
  
</body>
  
</html>
                     

Output:



After clicking the button

Supported Browsers: The browser supported by Screen height are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari

Attention reader! Don’t stop learning now. Get hold of all the important Comcompetitivepetitve Programming concepts with the Web Design for Beginners | HTML  course.




My Personal Notes arrow_drop_up
Recommended Articles
Page :