HTML代碼javascript
<!DOCTYPE html> <html lang="zh-cn"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no"> <title>項目實戰</title> <link rel="stylesheet" href="css/bootstrap.min.css"> <link rel="stylesheet" href="css/style.css"> </head> <body> <nav class="navbar navbar-default navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <a href="#" class="navbar-brand logo"><img src="img/logo.png" alt="瓢城企訓網"></a> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <div class="collapse navbar-collapse" id="navbar-collapse"> <ul class="nav navbar-nav navbar-right"> <li class="active"><a href="#"><span class="glyphicon glyphicon-home"></span> 首頁</a></li> <li><a href="#"><span class="glyphicon glyphicon-list"></span> 資訊</a></li> <li><a href="#"><span class="glyphicon glyphicon-fire"></span> 案例</a></li> <li><a href="#"><span class="glyphicon glyphicon-question-sign"></span> 關於</a></li> </ul> </div> </div> </nav> <div id="myCarousel" class="carousel slide"> <ol class="carousel-indicators"> <li data-target="#myCarousel" data-slide-to="0" class="active"></li> <li data-target="#myCarousel" data-slide-to="1"></li> <li data-target="#myCarousel" data-slide-to="2"></li> </ol> <div class="carousel-inner"> <div class="item active" style="background:#223240"> <img src="img/slide1.png" alt="第一張"> </div> <div class="item" style="background:#F5E4DC;"> <img src="img/slide2.png" alt="第二張"> </div> <div class="item" style="background:#DE2A2D;"> <img src="img/slide3.png" alt="第三張"> </div> <!-- <div style="background:#eee;"> <img src="img/slide.png" alt="第三張"> </div> --> </div> <a href="#myCarousel" data-slide="prev" class="carousel-control left"> <span class="glyphicon glyphicon-chevron-left"></span> </a> <a href="#myCarousel" data-slide="next" class="carousel-control right"> <span class="glyphicon glyphicon-chevron-right"></span> </a> </div> <div class="tab1"> <div class="container"> <h2 class="tab-h2">「爲何選擇瓢城企業培訓」</h2> <p class="tab-p">強大的師資力量,完美的實戰型管理課程,讓您的企業實現質的騰飛!</p> <div class="row"> <div class="col-md-6 col"> <div class="media"> <div class="media-left"> <a href="#"><img src="img/tab1-1.png" class="media-object" alt=""></a> </div> <div class="media-body"> <h4 class="media-heading">課程內容</h4> <p class="text-muted">其餘:高校不知名的講師編寫,沒有任何實戰價值的教材!</p> <p>咱們:知名企業家、管理學大師聯合編寫的具備實現性教材!</p> </div> </div> </div> <div class="col-md-6 col"> <div class="media"> <div class="media-left"> <a href="#"><img src="img/tab1-2.png" class="media-object" alt=""></a> </div> <div class="media-body"> <h4 class="media-heading">師資力量</h4> <p class="text-muted">其餘:非歐美正牌大學畢業的、業界沒有知名度的講師!</p> <p>咱們:美國哈佛、耶魯等世界一流高校、享有聲譽的名牌專家!</p> </div> </div> </div> <div class="col-md-6 col"> <div class="media"> <div class="media-left"> <a href="#"><img src="img/tab1-3.png" class="media-object" alt=""></a> </div> <div class="media-body"> <h4 class="media-heading">課時安排</h4> <p class="text-muted">其餘:沒法保證上課效率、沒有時間表,任務沒法完成!</p> <p>咱們:保證按時間表的上課、效率高、當天的任務當天完成!</p> </div> </div> </div> <div class="col-md-6 col"> <div class="media"> <div class="media-left"> <a href="#"><img src="img/tab1-4.png" class="media-object" alt=""></a> </div> <div class="media-body"> <h4 class="media-heading">服務團隊</h4> <p class="text-muted">其餘:社會招聘的、服務水平良莠不齊的普通員工!</p> <p>咱們:內部培養、經受過良好高端服務培訓的高標準員工!</p> </div> </div> </div> </div> </div> </div> <div class="tab2"> <div class="container"> <div class="row"> <div class="col-md-6 col-sm-6 tab2-img"> <img src="img/tab2.png" class="auto img-responsive center-block" alt=""> </div> <div class="text col-md-6 col-sm-6 tab2-text"> <h3>強大的學習體系</h3> <p>通過管理學大師層層把關、讓您的企業日新月異。</p> </div> </div> </div> </div> <div class="tab3"> <div class="container"> <div class="row"> <div class="col-md-6 col-sm-6"> <img src="img/tab3.png" class="auto img-responsive center-block" alt=""> </div> <div class="text col-md-6 col-sm-6"> <h3>完美的管理方式</h3> <p>最新的管理培訓方案,讓您的企業趕超同行。</p> </div> </div> </div> </div> <footer id="footer"> <div class="container"> <p>企業培訓 | 合做事宜 | 版權投訴</p> <p>蘇ICP 備12345678. © 2009-2016 瓢城企訓網. Powered by Bootstrap.</p> </div> </footer> <script src="js/jquery.min.js"></script> <script src="js/bootstrap.min.js"></script> <script type="text/javascript"> $(function () { //輪播自動播放 $('#myCarousel').carousel({ //自動4秒播放 interval : 4000, }); // //設置垂直居中 // $('.carousel-control').css('line-height', $('.carousel-inner img').height() + 'px'); // $(window).resize(function () { // var $height = $('.carousel-inner img').eq(0).height() || // $('.carousel-inner img').eq(1).height() || // $('.carousel-inner img').eq(2).height(); // $('.carousel-control').css('line-height', $height + 'px'); // }); //設置文字垂直居中 $('.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'); }); }); </script> </body> </html>
@charset "utf-8"; body { font-family: "Helvetica Neue", Helvetica, Arial, "Microsoft Yahei UI", "Microsoft YaHei", SimHei, "\5B8B\4F53", simsun, sans-serif; color: #666; } .logo { padding:0; } #myCarousel { margin: 50px 0 0 0; } #navbar-collapse ul { margin-top:0; } .carousel-inner img { margin: 0 auto; } /*.carousel-control { font-size: 100px; }*/ .tab-h2 { font-size: 20px; text-align: center; letter-spacing: 1px; color: #0059b2; } .tab-p { font-size: 15px; text-align: center; letter-spacing: 1px; color: #999; margin: 20px 0 40px 0; } .tab1 { margin: 30px 0; color: #666; } .tab1 .text-muted { color: #999; text-decoration: line-through; } .tab1 .media-heading { margin: 5px 0 20px 0; } .tab1 .col { padding: 20px; } .tab2 { background-color: #eee; padding: 60px 20px; text-align: center; } .tab2 img { width: 40%; height: 40%; } .tab3 { padding: 60px 20px; text-align: center; } .tab3 img { width: 65%; height: 65%; } .text h3 { font-size: 20px; } .text p { font-size: 14px; } #footer { background-color: #eee; border-top: 1px solid #ccc; padding: 20px; text-align: center; } /*沒有小於768px,是由於Bootstrap3以移動端優先設計*/ /* 小屏幕(平板,大於等於768px) */ @media (min-width: 768px) { .tab-h2 { font-size: 26px; } .tab-p { font-size: 16px; } .text h3 { font-size: 22px; } .text p { font-size: 15px; } .tab2-text { float: left; } .tab2-img { float: right; } } /* 中等屏幕(桌面顯示器,大於等於992px) */ @media (min-width: 992px) { .tab-h2 { font-size: 28px; } .tab-p { font-size: 17px; } .text h3 { font-size: 24px; } .text p { font-size: 16px; } } /* 大屏幕(大桌面顯示器,大於等於1200px) */ @media (min-width: 1200px) { .tab-h2 { font-size: 30px; } .tab-p { font-size: 18px; } .text h3 { font-size: 26px; } .text p { font-size: 18px; } }