M
M
Minningt2015-10-20 19:04:51
css
Minningt, 2015-10-20 19:04:51

How to stretch video by 100% if height is specified?

Actually, the question is in the title.
Thanks for the answers
jsfiddle.net/yf404ndz/1

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Elena, 2015-10-21
@Minningt

I propose like this:

<section id="sect_sel">
    <video id="video" autoplay="autoplay" loop="loop" preload="auto" muted>
    <source src="_images/rest.mp4"></source>
    </video>          
</section>

CSS styles:
section {
    display: block;
    width: 100%;
    height: 200px;
    overflow: hidden;
}
video {
    display: block;
    width: 100%;
}

V
Vladislav Startsev, 2015-10-21
@esvlad

If the height is specified, then no way, since the video is embedded with the preservation of its proportions, if one of the sides is fixed.
For example, open a video on a PC, make a small height (200 pixels) and stretch it by 100% with the mouse.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question