<div id="wrap">
<div class="center">
<div class="section">
<div class="tabbed">
<div class="tabbed__tabs">
<div class="tab tab--active"><span>video #1</span></div>
<div class="tab"><span>video #2</span></div>
<div class="tab"><span>video #3</span></div>
</div>
<div class="tabbed__pages">
<div class="page page--active">
<iframe src="https://www.youtube.com/embed/lfWDnyxt4bo" frameborder="0" allowfullscreen></iframe>
</div>
<div class="page">
<iframe src="https://www.youtube.com/embed/lfWDnyxt4bo" frameborder="0" allowfullscreen></iframe>
</div>
<div class="page">
<iframe src="https://www.youtube.com/embed/lfWDnyxt4bo" frameborder="0" allowfullscreen></iframe>
</div>
</div>
</div>
</div>
</div>
</div>
// autoprefixer: true
html,
body {
margin: 0;
padding: 0;
font-family: sans-serif;
font-size: 16px;
line-height: 1.4;
color: #555;
background: #fff;
}
* {
box-sizing: border-box;
}
#wrap {
position: relative;
padding-top: 60px;
transition: padding-top .3s ease;
}
.section {
padding: 40px;
}
.center {
width: 100%;
max-width: 1200px;
margin: auto;
}
.tabbed {
&__tabs {
display: flex;
}
&__pages {
position: relative;
padding-top: 56.21%;
}
}
.tab {
padding: 10px 20px;
background: #eee;
cursor: pointer;
user-select: none;
&--active {
background: #aef0cd;
cursor: default;
}
}
.page {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
visibility: hidden;
iframe {
width: 100%;
height: 100%;
}
&--active {
opacity: 1;
visibility: visible;
z-index: 1;
}
}
View Compiled
$(function() {
$('.tab').click(function() {
var tabIndex = $(this).index();
$('.tab').eq(tabIndex).addClass('tab--active').siblings().removeClass('tab--active');
$('.page').eq(tabIndex).addClass('page--active').siblings().removeClass('page--active');
});
});
This Pen doesn't use any external CSS resources.