1
我想要做的是拍攝兩張響應圖像,並在頁面爲xs時將它們旋轉爲水平,內聯和居中。我已經設法讓它工作。但是當我在最大的視圖中時,圖像是內聯的,我希望它們垂直顯示。當我縮小頁面時,圖像會回到垂直顯示狀態,直到達到xs點。 這裏的HTML如何在xs視圖中居中對齊圖像並旋轉到水平
<div class="row">
<div class="col-md-11 col-xs-12 col-sm-11">
<div id="carousel1" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carousel1" data-slide-to="0" class="active"></li>
<li data-target="#carousel1" data-slide-to="1"></li>
<li data-target="#carousel1" data-slide-to="2"></li>
</ol>
<div class="carousel-inner" role="listbox">
<div class="item active"><img src="/images/first image.JPG" alt="First slide image" width="596" height="450" class="center-block">
<div class="carousel-caption">
<h3>First slide Heading</h3>
<p>First slide Caption</p>
</div>
</div>
<div class="item"><img src="/images/second image.jpg" alt="Second slide image" width="582" height="450" class="center-block">
<div class="carousel-caption">
<h3>Second slide Heading</h3>
<p>Second slide Caption</p>
</div>
</div>
<div class="item"><img src="/images/IMG_1826.JPG" alt="Third slide image" width="588" height="441" class="center-block">
<div class="carousel-caption">
<h3>Third slide Heading</h3>
<p>Third slide Caption</p>
</div>
</div>
</div>
<a class="left carousel-control" href="#carousel1" role="button" data-slide="prev"><span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span><span class="sr-only">Previous</span></a><a class="right carousel-control" href="#carousel1" role="button" data-slide="next"><span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span><span class="sr-only">Next</span></a></div>
</div>
<div class="icons col-md-1 col-lg-1 col-sm-1 col-xs-12" id="logobox"><img src="/wood-instagram-icon.png" alt="Placeholder image" class="img-responsive" id="logo"><img src="/facebook-log-wood.png" alt="Placeholder image" class="img-responsive" id="logo"></div>
而這裏的CSS
}
#logo {
max-width: 50px;
max-height: 50px;
display: inline-block;
}
.icons.col-xs-12 #logobox {
display: inline-block;
}
#logobox {
text-align: center;
}
偉大的工程謝謝。這需要我花一點時間才能完全理解它,但除此之外,這正是我需要的。對於我定義的id是在alt =「」中定義的? – youngsquid
@youngsquid我很樂意提供幫助。 'alt'不定義任何。我用'alt'作爲評論。你可以改變它到你需要的。 –
當你說這個ID必須是唯一的兩個圖像你指的是什麼? – youngsquid