Computer >> คอมพิวเตอร์ >  >> การเขียนโปรแกรม >> CSS

ใช้คุณสมบัติ CSS max-width ที่ตอบสนองสำหรับเครื่องเล่นวิดีโอ


คุณสามารถลองเรียกใช้โค้ดต่อไปนี้เพื่อใช้ ความกว้างสูงสุด คุณสมบัติเพื่อให้เครื่องเล่นวิดีโอของคุณตอบสนอง -

ตัวอย่าง

<!DOCTYPE html>
<html>
   <head>
      <meta name = "viewport" content = "width=device-width, initial-scale = 1.0">
      <style>
         video {
            max-width: 100%;
            height: auto;
         }
      </style>
   </head>
   <body>
      <video width = "300" controls autoplay>
         <source src = "/html5/foo.ogg" type = "video/ogg" />
         <source src = "/html5/foo.mp4" type = "video/mp4" />
      </video>
      <p>To check the effect, you need to resize the browser.</p>
   </body>
</html>