DEV Community

AKSH DESAI
AKSH DESAI

Posted on

CSS Min-height & Max-height Tutorial

10. Code

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Min Height and Max Height</title>

  <style>
    #first {
      width: 700px;
      min-height: 100px;
      max-height: 200px;
      border: 2px solid red;
    }
  </style>
</head>

<body>

  <h1> Yahoo Baba. CSS Min-Height and Max-Height </h1>

  <div id="first">
    Lorem, ipsum dolor sit amet consectetur adipisicing elit. Vero quasi quod numquam veritatis sequi facilis aperiam ipsam ea quia maxime?
    Lorem, ipsum dolor sit amet consectetur adipisicing elit. Vero quasi quod numquam veritatis sequi facilis aperiam ipsam ea quia maxime?
    Lorem, ipsum dolor sit amet consectetur adipisicing elit. Vero quasi quod numquam veritatis sequi facilis aperiam ipsam ea quia maxime?
    Lorem, ipsum dolor sit amet consectetur adipisicing elit. Vero quasi quod numquam veritatis sequi facilis aperiam ipsam ea quia maxime?
    Lorem, ipsum dolor sit amet consectetur adipisicing elit. Vero quasi quod numquam veritatis sequi facilis aperiam ipsam ea quia maxime?
    Lorem, ipsum dolor sit amet consectetur adipisicing elit. Vero quasi quod numquam veritatis sequi facilis aperiam ipsam ea quia maxime?
    Lorem, ipsum dolor sit amet consectetur adipisicing elit. Vero quasi quod numquam veritatis sequi facilis aperiam ipsam ea quia maxime?
    Lorem, ipsum dolor sit amet consectetur adipisicing elit. Vero quasi quod numquam veritatis sequi facilis aperiam ipsam ea quia maxime?
    Lorem, ipsum dolor sit amet consectetur adipisicing elit. Vero quasi quod numquam veritatis sequi facilis aperiam ipsam ea quia maxime?
    Lorem, ipsum dolor sit amet consectetur adipisicing elit. Vero quasi quod numquam veritatis sequi facilis aperiam ipsam ea quia maxime?
  </div>
</body>

<script>
  document.getElementById("first").contentEditable = 'true'
</script>

</html>
Enter fullscreen mode Exit fullscreen mode

Output
Output

Thank You.
You can follow us on:
Youtube
Instagram

Top comments (0)