How to set the width and height of the video in the video tag in HTML5

Xiaobian to everyone to share the width and height of the Video tag in HTML5, I believe that most people don’t know much, so share this article to everyone, I hope everyone is reading this article. Have a gain, let’s take a look at it!

Object-fit grammar

Object-fit: Fill | Contain | Cover | None | scale-down

Object-fit take Note

Object-fit is mainly suitable for replacement elements, such as:


, , , and , etc. Its default is Fill . The description of the value of Object-Fill is as follows: Fill: This value is the default value of BOJECT-FIT, and the size of the replacement content is set to the content box of the fill element, that is, The content of the element is expanded to the outer dimensions of the fully filled container, even if it breaks its inherent aspect ratio. Contain: The replacement element content size holds a long width ratio fill element content container, and the specific object size is parsed to a width and height containing an element. That is, if you set a clear on the alternative elementThe height and width of the index will result in the content size, completely displayed in a fixed ratio, but still displayed in the element size. Cover: The replacement element content size maintains a long-width ratio fill element content container, and the specific object size is parsed to cover the width and height of the entire element. That is, the content size of the replacement element remains a long width ratio, but changes the width and height to completely cover the content elements.

  • NONE: Replace element content does not adjust the size to accommodate the container of the internal element, and the content is completely ignored to any height and weight set on the element, and still in the element. Displayed in size.

    Scale-Down: When the content size is set

  • or
  • contain

    , the specific object will result in more small.

    The above is how the VIDEO tag in HTML5 sets the width and height of the video, thank you for reading! I believe everyone has a certain understanding, I hope to share the content of everyone, if you want to learn more knowledge, please pay attention to Tumi Yun Industry News Channel!
© Copyright Notice
Just support it if you like
comment Grab the couch

Please log in to comment