Bootstrap項(xiàng)目實(shí)戰(zhàn)之首頁(yè)內(nèi)容介紹(全)

字號(hào):


    本文分為兩部分介紹Bootstrap首頁(yè)內(nèi)容介紹的實(shí)現(xiàn)代碼,感興趣的小伙伴們可以參考一下
    本節(jié)課第一節(jié)我們輪播圖的下方,設(shè)計(jì)一個(gè)內(nèi)容介紹,內(nèi)容介紹分兩部分,本次為上半部分。
    一.首頁(yè)內(nèi)容介紹 
    //關(guān)于上節(jié)課輪播圖,手冊(cè)上其實(shí)有一個(gè)更好的方案,并不需要通過(guò)額外的代碼控制。
    <a href="#myCarousel" data-slide="prev"> <span></span> </a>
    <a href="#myCarousel" data-slide="next"> <span></span> </a>
    //內(nèi)容介紹上
    ---------------------------------------------------------------------------
    <div>
      <div>
        <h2>「 為什么選擇瓢城企業(yè)培訓(xùn) 」</h2>
        <p>
          強(qiáng)大的師資力量,完美的實(shí)戰(zhàn)型管理課程,讓您的企業(yè)實(shí)現(xiàn)質(zhì)的騰飛!
        </p>
        <div>
          <div>
            <div>
              <div>
                <a href="#"> <img
                src="img/tab1-1.png"> </a>
              </div>
              <div>
                <h4>課程內(nèi)容</h4>
                <p>
                  其他:高校不知名的講師編寫,沒(méi)有任何實(shí)戰(zhàn)價(jià)值的教材!
                </p>
                <p>
                  其他:知名企業(yè)家、管理學(xué)大師聯(lián)合編寫的具有實(shí)現(xiàn)性教材!
                </p>
              </div>
            </div>
          </div>
          <div>
            <div>
              <div>
                <a href="#"> <img
                src="img/tab1-2.png"> </a>
              </div>
              <div>
                <h4>師資力量</h4>
                <p>
                  其他:非歐美正牌大學(xué)畢業(yè)的、業(yè)界沒(méi)有知名度的講師!
                </p>
                <p>
                  其他:美國(guó)哈佛、耶魯?shù)仁澜缫涣鞲咝?、享有聲譽(yù)的名牌專家!
                </p>
              </div>
            </div>
          </div>
          <div>
            <div>
              <div>
                <a href="#"> <img
                src="img/tab1-3.png"> </a>
              </div>
              <div>
                <h4>課時(shí)安排</h4>
                <p>
                  其他:無(wú)法保證上課效率、沒(méi)有時(shí)間表,任務(wù)無(wú)法完成!
                </p>
                <p>
                  其他:保證正常的上課效率、制定一張時(shí)間表、當(dāng)天的任務(wù)當(dāng)天完成!
                </p>
              </div>
            </div>
          </div>
          <div>
            <div>
              <div>
                <a href="#"> <img
                src="img/tab1-4.png"> </a>
              </div>
              <div>
                <h4>服務(wù)團(tuán)隊(duì)</h4>
                <p>
                  其他:社會(huì)招聘的、服務(wù)水平參差不齊的普通員工!
                </p>
                <p>
                  其他:內(nèi)部培養(yǎng)、經(jīng)受過(guò)良好高端服務(wù)培訓(xùn)的高標(biāo)準(zhǔn)員工!
                </p>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    對(duì)應(yīng)的 CSS 部分
    body {
      font-family: "Helvetica Neue", Helvetica, Arial, "Microsoft YaheiUI", "Microsoft YaHei", SimHei, "\5B8B\4F53", simsun, sans-serif;
    }
    .tab-h2 {
      font-size: 20px;
      color: #0059B2;
      text-align: center;
      letter-spacing: 1px;
    }
    .tab-p {
      font-size: 15px;
      color: #999;
      text-align: center;
      letter-spacing: 1px;
      margin: 20px 0 40px 0;
    }
    .tab1 {
      margin: 30px 0;
      color: #666;
    }
    .tab1 .media-heading {
      margin: 5px 0 20px 0;
    }
    .tab1 .text-muted {
      color: #999;
      text-decoration: line-through;
    }
    .tab1 .media-heading {
      margin: 5px 0 20px 0;
    }
    .tab1 .text-muted {
      color: #999;
      text-decoration: line-through;
    }
    .tab1 .col {
      padding: 20px;
    }
    /* 小屏幕(平板,大于等于 768px) */
    @media (min-width: 768px) {
      .tab-h2 {
        font-size: 26px;
      }
      .tab-p {
        font-size: 16px;
      }
    }
    /* 中等屏幕(桌面顯示器,大于等于 992px) */
    @media (min-width: 992px) {
      .tab-h2 {
        font-size: 28px;
      }
      .tab-p {
        font-size: 17px;
      }
    }
    /* 大屏幕(大桌面顯示器,大于等于 1200px) */
    @media (min-width: 1200px) {
      .tab-h2 {
        font-size: 30px;
      }
      .tab-p {
        font-size: 18px;
      }
    }
    現(xiàn)在我們制作一下首頁(yè)內(nèi)容介紹的下半部分。
    一.首頁(yè)內(nèi)容介紹
    先完成底部的 footer
    <footer id="footer">
      <div>
        <p>
          企業(yè)培訓(xùn) | 合作事宜 | 版權(quán)投訴
        </p>
        <p>
          蘇 ICP 備 12345678. © 2009-2016 瓢城企訓(xùn)網(wǎng). Powered by
          Bootstrap.
        </p>
      </div>
    </footer>
    底部 CSS
    #footer {
      padding: 20px;
      text-align: center;
      background-color: #eee;
      border-top: 1px solid #ccc;
    }
    //兩段內(nèi)容
    <div>
      <div>
        <div>
          <div>
            <img src="img/tab2.png">
          </div>
          <div>
            <h3>強(qiáng)大的學(xué)習(xí)體系</h3>
            <p>
              經(jīng)過(guò)管理學(xué)大師層層把關(guān)、讓您的企業(yè)突飛猛進(jìn)。
            </p>
          </div>
        </div>
      </div>
    </div>
    <div>
      <div>
        <div>
          <div>
            <img src="img/tab3.png">
          </div>
          <div>
            <h3>完美的管理方式</h3>
            <p>
              最新的管理培訓(xùn)方案,讓您的企業(yè)趕超同行。
            </p>
          </div>
        </div>
      </div>
    </div>
    CSS 部分
    .tab2 {
      background: #eee;
      padding: 60px 20px;
      text-align: center;
    }
    .tab2 img {
      width: 40%;
      height: 40%;
    }
    .tab3 {
      padding: 40px 0;
      text-align: center;
    }
    .tab3 img {
      width: 65%;
      height: 65%;
    }
    .text h3 {
      font-size: 20px;
    }
    .text p {
      font-size: 14px;
    }
    /* 小屏幕(平板,大于等于 768px) */
    @media (min-width: 768px) {
      .text h3 {
        font-size: 22px;
      }
      .text p {
        font-size: 15px;
      }
      .tab2-text {
        float: left;
      }
      .tab2-img {
        float: right;
      }
    }
    /* 中等屏幕(桌面顯示器,大于等于 992px) */
    @media (min-width: 992px) {
      .text h3 {
        font-size: 24px;
      }
      .text p {
        font-size: 16px;
      }
      .tab2-text {
        float: left;
      }
      .tab2-img {
        float: right;
      }
    }
    /* 大屏幕(大桌面顯示器,大于等于 1200px) */
    @media (min-width: 1200px) {
      .text h2 {
        font-size: 26px;
      }
      .text p {
        font-size: 18px;
      }
      .tab2-text {
        float: left;
      }
      .tab2-img {
        float: right;
      }
    }
    JS 控制垂直居中
    $('.text').eq(0).css('margin-top', ($('.auto').eq(0).height() - $('.text').eq(0).height()) / 2 + 'px');
    $(window).resize(function() {
      $('.text').eq(0).css('margin-top', ($('.auto').eq(0).height() - $('.text').eq(0).height()) / 2 + 'px');
    });
    $('.text').eq(1).css('margin-top', ($('.auto').eq(1).height() - $('.text').eq(1).height()) / 2 + 'px');
    $(window).resize(function() {
      $('.text').eq(1).css('margin-top', ($('.auto').eq(1).height() - $('.text').eq(1).height()) / 2 + 'px');
    });
    以上就是Bootstrap首頁(yè)內(nèi)容介紹的全部?jī)?nèi)容,希望大家喜歡,之后還會(huì)有更多精彩的內(nèi)容呈現(xiàn),不要錯(cuò)過(guò)。