HTML height 속성은 요소의 높이(픽셀 단위)를 선언하는 데 사용됩니다.
참고 − HTML5 기준 높이를 '%'로 지정하는 지원이 제거되었습니다.
HTML의 다음 요소에는 높이 속성이 있습니다 -
- 캔버스
- 삽입
- iframe
- 이미지
- 입력
- 개체
- 동영상
동영상 높이 의 예를 살펴보겠습니다. 속성 -
예시
<!DOCTYPE html>
<html>
<head>
<title>HTML DOM Video height</title>
<style>
* {
padding: 2px;
margin:5px;
}
form {
width:70%;
margin: 0 auto;
text-align: center;
}
input[type="button"] {
border-radius: 10px;
}
</style>
</head>
<body>
<form>
<fieldset>
<legend>HTML-DOM-Video-height</legend>
<video id="wordPressIntro" width="320" height="50" controls><source src=" https://www.tutorialspoint.com/html5/foo.mp4" type="video/mp4"></video><br>
<input type="button" onclick="getTrackDetails()" value="Video Not Visible">
<div id="divDisplay"></div>
</fieldset>
</form>
<script>
var divDisplay = document.getElementById("divDisplay");
var wordPressIntro = document.getElementById("wordPressIntro");
function getTrackDetails() {
wordPressIntro.height += 50;
divDisplay.textContent = 'Video height: '+wordPressIntro.height;
}
</script>
</body>
</html> 이것은 다음과 같은 출력을 생성합니다 -
1) '동영상이 보이지 않음'을 클릭하기 전에 버튼 -

2) '동영상이 표시되지 않음 클릭 ' 버튼 3번 -
