HTML में किसी एलिमेंट की ऊंचाई सेट करने के लिए height एट्रिब्यूट का उपयोग करें। आप निम्न एलिमेंट्स के साथ इस एट्रिब्यूट का उपयोग कर सकते हैं: <canvas>, <embed>, <img>, <input>, <video>, आदि।
उदाहरण
HTML में height एट्रिब्यूट लागू करने का कोड:
<!DOCTYPE HTML>
<html>
<body>
<video width="300" height="200" controls autoplay>
<source src="/html5/foo.ogg" type="video/ogg" />
<source src="/html5/foo.mp4" type="video/mp4" />
Your browser does not support the video element.
</video>
</body>
</html>
width और height एट्रिब्यूट्स इमेज/वीडियो के आकार को रिज़र्व करते हैं जिससे लेआउट शिफ्ट नहीं होता। CSS में भी width/height प्रॉपर्टीज़ का उपयोग कर सकते हैं।