使用Bootstrap 3開發響應式網站實踐02,輪播

來源:互聯網
上載者:User

標籤:des   style   blog   http   color   os   使用   io   for   

本篇體驗圖片輪播。html部分為:

        <div class="carousel slide" id="myCarousel"  >
            <!--Indicators-->
            <ol class="carousel-indicators">
                <li class="active" data-slide-to="0" data-target="#myCarousel"></li>
                <li data-slide-to="1" data-target="#myCarousel"></li>
                <li data-slide-to="2" data-target="#myCarousel"></li>
            </ol>
            <!--wrapper for slides-->
            <div class="carousel-inner">
                <div class="item active" id="slide1">
                    <img src="images/25.jpg"/>
                    <div class="carousel-caption">
                        <h4>馬塔破門曼聯平</h4>
                        <p>2014/15賽季英格蘭足球超級聯賽第2輪一場焦點戰在光明球場展開角逐</p>
                    </div>
                </div>
                
                <div class="item" id="slide2">
                    <img src="images/26.jpg"/>
                    <div class="carousel-caption">
                        <h4>魯尼範佩西召喚天使</h4>
                        <p>客場被桑德蘭1-1逼平,曼聯雖然拿到一分,但顯然紅魔從上到下沒人會滿意2戰1分的慘淡結果。</p>
                    </div>
                </div>
                
                <div class="item" id="slide3">
                    <img src="images/27.jpg"/>
                    <div class="carousel-caption">
                        <h4>迪馬利亞今日飛抵曼聯體檢</h4>
                        <p>曼聯引進迪馬利亞的交易已經只差官方宣布,這無疑是替紅魔官方宣布了這筆交易。</p>
                    </div>
                </div>
            </div>
            <!--controller-->
            <a class="left carousel-control" data-slide="prev" href="#myCarousel"><span class="icon-prev"></span></a>
            <a class="right carousel-control" data-slide="next" href="#myCarousel"><span class="icon-next"></span></a>
        </div><!--圖片展示地區結束-->

○ 輪播所有內容被包裹在帶有class="carousel slide"的div中  
○ 輪播分3部分:圓點指示,用ol實現;圖片、標題、描述用div實現;左右2個箭頭用a實現

  


參考資料:
Code a Responsive Website with Bootstrap 3 --by Brad Hussey
http://getbootstrap.com/
http://bootswatch.com/
http://www.tutorialspoint.com/
http://www.placehold.it/

 

“使用Bootstrap 3開發響應式網站實踐”系列包括:

使用Bootstrap 3開發響應式網站實踐01,前期準備、導航地區等使用Bootstrap 3開發響應式網站實踐02,輪播

使用Bootstrap 3開發響應式網站實踐02,輪播

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.