如何在 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-6 月 -2020

104 次瀏覽

開啟你的 職業生涯

透過完成課程獲得認證

開始學習
廣告
© . All rights reserved.