你需要讓你的.carousel
類作爲100%
的寬度..
你需要做下面的改變你的CSS,
.carousel{
width: 100%;
margin: auto;
}
.carousel-inner > .item > img,
.carousel-inner > .item > a > img {
width: 100%;
margin: auto;
}
但是如果你想要讓他們在480x320px最初和想要在瀏覽器調整大小時處理它們,那麼您需要進行媒體查詢。
/* For devices which are smaller than 960 pixels */
@media only screen and (max-width: 959px) {
//Write your CSS here.
}
/* For Tablets */
@media only screen and (min-width: 768px) and (max-width: 959px) {
//Write your CSS here.
}
/* For all mobiles */
@media only screen and (max-width: 767px) {
//Write your CSS here.
}
/* Mobile Landscape Size to Tablet Portrait */
@media only screen and (min-width: 480px) and (max-width: 767px) {
//Write your CSS here.
}
/* Mobile Portrait Size to Mobile Landscape Size (devices and browsers) */
@media only screen and (max-width: 479px) {
//Write your CSS here.
}
希望這有助於!
我想在完整的瀏覽器屏幕上顯示480x320px的輪播/圖片,但是當您開始調整大小時,瀏覽器輪播/圖片也會縮小。 –
然後,您需要選擇編寫媒體查詢。檢查我上面的更新的答案。 –