如何新增元素的高度到 HTML?


使用 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>

更新於: 24-06-2020

105 次瀏覽

開啟你的 職業生涯

完成課程取得認證

立即開始
廣告