কম্পিউটার টিউটোরিয়াল

HTML DOM Style maxHeight প্রোপার্টি


DOM style maxHeight প্রোপার্টি HTML ডকুমেন্টে একটি এলিমেন্টের সর্বোচ্চ উচ্চতা রিটার্ন ও পরিবর্তন করে।

সিনট্যাক্স

নিচে সিনট্যাক্স দেওয়া হলো:

  • maxHeight রিটার্ন করা

object.style.maxHeight
  • maxHeight পরিবর্তন করা

object.style.maxHeight = "value"

মানগুলো

এখানে, value হতে পারে:

মান ব্যাখ্যা
None এটি এলিমেন্টের উচ্চতার ওপর কোনো লিমিট সেট করে না।
inherit এটি প্যারেন্ট এলিমেন্ট থেকে এই প্রোপার্টির মান ইনহেরিট করে।
initial এটি এই প্রোপার্টির মান ডিফল্ট ভ্যালুতে সেট করে।
length এটি দৈর্ঘ্য এককের মাধ্যমে মান সেট করে।
percentage(%) এটি প্যারেন্ট এলিমেন্টের উচ্চতার শতাংশের মাধ্যমে মান সেট করে।

উদাহরণ

Style maxHeight প্রোপার্টির একটি উদাহরণ দেখি:

<!DOCTYPE html> <html> <head> <style>    body {       color: #000;       background-image: linear-gradient(to top, #a18cd1 0%, #fbc2eb 100%);       height: 100vh;    }    p {       border: 2px solid #fff;       width: 200px;       overflow: auto;    }    .btn {       background: coral;       border: none;       height: 2rem;       border-radius: 2px;       width: 40%;       display: block;       color: #fff;       outline: none;       cursor: pointer;       margin-top: 4rem;    } </style> </head> <body> <h1>DOM Style maxHeight Property Example</h1> <p>    This is paragraph 1 with some dummy text.    This is paragraph 1 with some dummy text.    This is paragraph 1 with some dummy text.    This is paragraph 1 with some dummy text.    This is paragraph 1 with some dummy text.    This is paragraph 1 with some dummy text. </p> <button onclick="add()" class="btn">Set maxHeight</button> <script>    function add() {       document.querySelector('p').style.maxHeight = "100px";    } </script> </body> </html>

আউটপুট

এটি নিচের আউটপুট তৈরি করবে:

HTML DOM Style maxHeight প্রোপার্টি

Set maxHeight বাটনে ক্লিক করুন প্যারাগ্রাফ এলিমেন্টের সর্বোচ্চ উচ্চতা সেট করতে।

HTML DOM Style maxHeight প্রোপার্টি


  1. HTML DOM Style boxShadow প্রপার্টি

  2. HTML DOM Style counterReset প্রপার্টি

  3. HTML DOM Style counterIncrement প্রপার্টি

  4. HTML DOM value প্রোপার্টি