本節課第一節我們輪播圖的下方,設計一個內容介紹,內容介紹分兩部分,本次為上半部分。
一.首頁內容介紹
//關於上節課輪播圖,手冊上其實有一個更好的方案,並不需要通過額外的代碼控制。 <a href="#myCarousel" data-slide="prev"> <span></span> </a><a href="#myCarousel" data-slide="next"> <span></span> </a>//內容介紹上
<div> <div> <h2>「 為什麼選擇瓢城企業培訓」</h2> <p> 強大的師資力量,完美的實戰型管理課程,讓您的企業實現質的騰飛! </p> <div> <div> <div> <div> <a href="#"> <img src="img/tab1-1.png"> </a> </div> <div> <h4>課程內容</h4> <p> 其他:高校不知名的講師編寫,沒有任何實戰價值的教材! </p> <p> 其他:知名企業家、管理學大師聯合編寫的具有實現性教材! </p> </div> </div> </div> <div> <div> <div> <a href="#"> <img src="img/tab1-2.png"> </a> </div> <div> <h4>師資力量</h4> <p> 其他:非歐美正牌大學畢業的、業界沒有知名度的講師! </p> <p> 其他:美國哈佛、耶魯等世界一流高校、享有聲譽的名牌專家! </p> </div> </div> </div> <div> <div> <div> <a href="#"> <img src="img/tab1-3.png"> </a> </div> <div> <h4>課時安排</h4> <p> 其他:無法保證上課效率、沒有時間表,任務無法完成! </p> <p> 其他:保證正常的上課效率、制定一張時間表、當天的任務當天完成! </p> </div> </div> </div> <div> <div> <div> <a href="#"> <img src="img/tab1-4.png"> </a> </div> <div> <h4>服務團隊</h4> <p> 其他:社會招聘的、服務水平參差不齊的普通員工! </p> <p> 其他:內部培養、經受過良好高端服務培訓的高標準員工! </p> </div> </div> </div> </div> </div></div>
對應的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; }}現在我們製作一下首頁內容介紹的下半部分。
一.首頁內容介紹
先完成底部的footer
<footer id="footer"> <div> <p> 企業培訓| 合作事宜| 版權投訴</p> <p> 蘇ICP 備12345678. © 2009-2016 瓢城企訓網. Powered by Bootstrap. </p> </div></footer>
底部CSS
#footer { padding: 20px; text-align: center; background-color: #eee; border-top: 1px solid #ccc;}//兩段內容<div> <div> <div> <div> <img src="img/tab2.png"> </div> <div> <h3>強大的學習體系</h3> <p> 經過管理學大師層層把關、讓您的企業突飛猛進。 </p> </div> </div> </div></div><div> <div> <div> <div> <img src="img/tab3.png"> </div> <div> <h3>完美的管理方式</h3> <p> 最新的管理培訓方案,讓您的企業赶超同行。 </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');});如果大家還想深入學習,可以點擊這裡進行學習,再為大家附3個精彩的專題:
Bootstrap學習教程
Bootstrap實戰教程
Bootstrap插件使用教程
以上就是Bootstrap首頁內容介紹的全部內容,希望大家喜歡,之後還會有更多精彩的內容呈現,不要錯過。