E
E
ElCHABA2015-03-15 12:35:00
Adaptive design
ElCHABA, 2015-03-15 12:35:00

Adaptive design. Several videos in a row, how to implement?

Good afternoon. There is a very common code for displaying responsive video on a page:
.video {
position: relative;
padding-bottom: 56.25%
height: 0;
overflow: hidden;
}
.video iframe,
.video object,
.video embed {
position: absolute;
top: 0;
left: 0;
width: 100%
height: 100%;
}
Can you please tell me how to implement the code for adequate display, if there are 2, 3, 5 players in one .Video block, for example?
In this example, all content simply collapses under one video.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Goryachkin, 2015-03-15
@abaddon65

You need to add a wrapper to each block with a saw. Here is an example:
HTML:

<div class="wrap">
  <div class="video-responsive">
    <iframe width="auto" height="auto" src="http://www.youtube.com/embed/mRrE8CFkkAg" frameborder="0" allowfullscreen></iframe>
  </div>
</div>
<div class="wrap">
  <div class="video-responsive">
    <iframe width="auto" height="auto" src="http://www.youtube.com/embed/mRrE8CFkkAg" frameborder="0" allowfullscreen></iframe>
  </div>
</div>

CSS:
.video-responsive { 
  position: relative; 
  padding-bottom: 56.25%; 
  height: 0; 
  overflow:hidden; 
} 
.video-responsive iframe, 
.video-responsive object, 
.video-responsive embed {
  position: absolute; 
  top: 0; 
  left: 0; 
  width: 100%;
  height: 100%; 
}

.wrap {
  position: relative;
  min-width: 300px;
  max-width: 800px;
}

Get two videos one below the other.
Live example

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question