這是我的HTML和CSS結構:HTML響應速度
/* IMPORTS */
/* COMMON STYLES */
html, body {
\t margin: 0;
\t height: 100%;
\t overflow: hidden
}
h1, h2, h3, h4, h5, h6 {
\t margin-top: 5px;
\t margin-bottom: 5px;
}
/* PAGE STYLES */
#video-container {
\t padding: 0;
\t height: 100vh;
}
#video {
\t background-color: #6d6;
\t height: 65vh;
}
#tv {
\t position: absolute;
\t top: 0;
\t right: 15px;
\t height: 50%;
}
#banner {
\t height: 5vh;
\t background-color: #fff;
}
#ctrl1, #ctrl2 {
\t height: 30vh;
}
#ctrl1 {
\t background-color: #66d;
}
#ctrl2 {
\t background-color: #6dd;
}
#updates-container {
\t padding: 0 15px;
\t background-color: #d66;
\t height: 100vh;
\t overflow: auto;
}
.update-data {
\t height: 35vh;
\t border-bottom: dashed 1px #000;
}
.update-data:last-child {
\t border-bottom: none !important;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div class="row">
<!-- LEFT SIDE -->
<div id="video-container" class="col-xs-8 col-sm-8">
<div class="row">
<div id="video" class="col-xs-12 col-sm-12">
<video autoplay loop id="tv">
<source type="video/mp4" src="https://static.videezy.com/system/resources/previews/000/005/571/original/keyboard_02.mp4">
<source type="application/ogg" src="https://static.videezy.com/system/resources/preview2s/000/005/571/original/keyboard_02.ogv">
<source type="video/webm" src="https://static.videezy.com/system/resources/preview3s/000/005/571/original/keyboard_02.webm">
Your browser does not support the video tag.
</video>
</div>
</div>
<div class="row">
<div id="banner" class="col-xs-12 col-sm-12 text-center">SAMPLE BANNER</div>
</div>
<div class="row">
<div id="ctrl1" class="col-xs-6 col-sm-6"></div>
<div id="ctrl2" class="col-xs-6 col-sm-6"></div>
</div>
</div>
<!-- RIGHT SIDE -->
<div id="updates-container" class="col-xs-4 col-sm-4">
<div class="update-data row">
<div class="col-xs-12 col-sm-12">
SAMPLE UPDATE 1
</div>
</div>
<div class="update-data row">
<div class="col-xs-12 col-sm-12">
SAMPLE UPDATE 2
</div>
</div>
<div class="update-data row">
<div class="col-xs-12 col-sm-12">
SAMPLE UPDATE 3
</div>
</div>
<div class="update-data row">
<div class="col-xs-12 col-sm-12">
SAMPLE UPDATE 4
</div>
</div>
</div>
</div>
現在我的問題是,如何將我的DIV updates-container
(帶有紅色背景)定位當瀏覽器屏幕很小時...
你可以在'.video-container'和'col-lg-4 col-md-4 col-xs上使用col-lg-8 col-md-8 col-xs-12 col-sm-12 -12 col-sm-12「替換爲'.update-container',這樣當它們到達'col-sm'時,它們都會佔用所有的列。不幸的是,當我嘗試它時,我看不到'.update-container' – Swellar