(項目實戰四)響應式資訊內容

1、諮詢內容

<nav class="navbar navbar-default navbar-fixed-top">
    <div class="container">
        <div class="navbar-header">
            <a href="#" class="navbar-brand logo"><img src="<%=path%>/img/logo.jpg" 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><a href="index.html"><span class="glyphicon glyphicon-home"></span> 首頁</a></li>
                <li class="active"><a href="#"><span class="glyphicon glyphicon-list"></span> 資訊</a></li>
                <li><a href="case.html"><span class="glyphicon glyphicon-fire"></span> 案例</a></li>
                <li><a href="about.html"><span class="glyphicon glyphicon-question-sign"></span> 關於</a></li>
            </ul>
        </div>
    </div>
</nav>

<div class="jumbotron">
    <div class="container">
        <hgroup>
            <h1>資訊</h1>
            <h4>企業內訓的最新動態、資源等...</h4>
        </hgroup>
    </div>
</div>

<div id="information">
    <div class="container">
        <div class="row">
            <div class="col-md-8">
                <div class="container-fluid" style="padding:0;">
                    <div class="row info-content">
                        <div class="col-md-5 col-sm-5 col-xs-5">
                            <img src="<%=path%>/img/info1.jpg" class="img-responsive" alt="">
                        </div>
                        <div class="col-md-7 col-sm-7 col-xs-7">
                            <h4>廣電總局發佈TVOS2.0 華爲阿里參與研發</h4>
                            <p class="hidden-xs">TVOS2.0是在TVOS1.0與華爲MediaOS及阿里巴巴YunOS融合的基礎上,打造的新一代智能電視操做系統。華爲主要承擔開發工做,內置的電視購物商城由阿里方面負責。</p>
                            <p>admin 15 / 10 / 11</p>
                        </div>
                    </div>
                    <div class="row info-content">
                        <div class="col-md-5 col-sm-5 col-xs-5">
                            <img src="<%=path%>/img/info2.jpg" class="img-responsive" alt="">
                        </div>
                        <div class="col-md-7 col-sm-7 col-xs-7">
                            <h4>蘋果四寸手機爲什麼要配置強大的A9處理器?</h4>
                            <p class="hidden-xs">蘋果明年初有可能對外發布一款通過升級的四英寸手機,至關於iPhone 5s。該手機將會配置蘋果在2015年旗艦手機中採用的A9處理器。配置性能如此強大的應用處理器?</p>
                            <p>admin 15 / 10 / 11</p>
                        </div>
                    </div>
                    <div class="row info-content">
                        <div class="col-md-5 col-sm-5 col-xs-5">
                            <img src="<%=path%>/img/info3.jpg" class="img-responsive" alt="">
                        </div>
                        <div class="col-md-7 col-sm-7 col-xs-7">
                            <h4>六家互聯網公司發聲明 抵制流量劫持等違法行爲</h4>
                            <p class="hidden-xs">六家互聯網公司(今日頭條、美團大衆點評網、360、騰訊、微博、小米科技)發佈聯合聲明,呼籲有關運營商打擊流量劫持,重視互聯網公司被流量劫持,可能致使的嚴重後果。</p>
                            <p>admin 15 / 10 / 11</p>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-md-4 info-right hidden-xs hidden-sm">
                <blockquote>
                    <h2>熱門資訊</h2>
                </blockquote>
                <div class="container-fluid">
                    <div class="row">
                        <div class="col-md-5 col-sm-5 col-xs-5" style="margin: 12px 0; padding: 0">
                            <img src="<%=path%>/img/info2.jpg" class="img-responsive" alt="">
                        </div>
                        <div class="col-md-7 col-sm-7 col-xs-7" style="padding-right: 0">
                            <h4>蘋果四寸手機爲什麼要配置強大的A9處理器?</h4>
                            <p>admin 15 / 10 / 11</p>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-5 col-sm-5 col-xs-5" style="margin: 12px 0; padding: 0">
                            <img src="<%=path%>/img/info1.jpg" class="img-responsive" alt="">
                        </div>
                        <div class="col-md-7 col-sm-7 col-xs-7" style="padding-right: 0">
                            <h4>廣電總局發佈TVOS2.0 華爲阿里參與研發</h4>
                            <p>admin 15 / 10 / 11</p>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-5 col-sm-5 col-xs-5" style="margin: 12px 0; padding: 0">
                            <img src="<%=path%>/img/info3.jpg" class="img-responsive" alt="">
                        </div>
                        <div class="col-md-7 col-sm-7 col-xs-7" style="padding-right: 0">
                            <h4>六家互聯網公司發聲明 抵制流量劫持等違法行爲</h4>
                            <p>admin 15 / 10 / 11</p>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-5 col-sm-5 col-xs-5" style="margin: 12px 0; padding: 0">
                            <img src="<%=path%>/img/info2.jpg" class="img-responsive" alt="">
                        </div>
                        <div class="col-md-7 col-sm-7 col-xs-7" style="padding-right: 0">
                            <h4>蘋果四寸手機爲什麼要配置強大的A9處理器?</h4>
                            <p>admin 15 / 10 / 11</p>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-5 col-sm-5 col-xs-5" style="margin: 12px 0; padding: 0">
                            <img src="<%=path%>/img/info1.jpg" class="img-responsive" alt="">
                        </div>
                        <div class="col-md-7 col-sm-7 col-xs-7" style="padding-right: 0">
                            <h4>廣電總局發佈TVOS2.0 華爲阿里參與研發</h4>
                            <p>admin 15 / 10 / 11</p>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-5 col-sm-5 col-xs-5" style="margin: 12px 0; padding: 0">
                            <img src="<%=path%>/img/info3.jpg" class="img-responsive" alt="">
                        </div>
                        <div class="col-md-7 col-sm-7 col-xs-7" style="padding-right: 0">
                            <h4>六家互聯網公司發聲明 抵制流量劫持等違法行爲</h4>
                            <p>admin 15 / 10 / 11</p>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-5 col-sm-5 col-xs-5" style="margin: 12px 0; padding: 0">
                            <img src="<%=path%>/img/info2.jpg" class="img-responsive" alt="">
                        </div>
                        <div class="col-md-7 col-sm-7 col-xs-7" style="padding-right: 0">
                            <h4>蘋果四寸手機爲什麼要配置強大的A9處理器?</h4>
                            <p>admin 15 / 10 / 11</p>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-5 col-sm-5 col-xs-5" style="margin: 12px 0; padding: 0">
                            <img src="<%=path%>/img/info1.jpg" class="img-responsive" alt="">
                        </div>
                        <div class="col-md-7 col-sm-7 col-xs-7" style="padding-right: 0">
                            <h4>廣電總局發佈TVOS2.0 華爲阿里參與研發</h4>
                            <p>admin 15 / 10 / 11</p>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-5 col-sm-5 col-xs-5" style="margin: 12px 0; padding: 0">
                            <img src="<%=path%>/img/info3.jpg" class="img-responsive" alt="">
                        </div>
                        <div class="col-md-7 col-sm-7 col-xs-7" style="padding-right: 0">
                            <h4>六家互聯網公司發聲明 抵制流量劫持等違法行爲</h4>
                            <p>admin 15 / 10 / 11</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<footer id="footer">
    <div class="container">
        <p>企業培訓 | 合做事宜 | 版權投訴</p>
        <p>蘇ICP 備12345678. © 2009-2016 瓢城企訓網. Powered by Bootstrap.</p>
    </div>
</footer>
  • CSS以下
@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;
}
.jumbotron {
    background-image: url(../img/bg.jpg);
    margin: 50px 0 0 0;
    color: #ccc;
}
.jumbotron h1 {
    font-size: 26px;
    padding: 0 0 0 20px;
}
.jumbotron h4 {
    font-size: 15px;
    padding: 0 0 0 20px;
}
#information {
    background-color: #eee;
    padding: 40px 0;
}
.info-content {
    background-color: #fff;
    margin: 0 0 20px 0;
    box-shadow: 2px 2px 3px #ccc;
}
.info-content img {
    margin: 12px 0;
}
.info-content h4 {
    color: #333;
    padding: 2px 0 0 0;
    font-size: 14px;
}
.info-content p {
    line-height: 1.6;
}
.info-right {
    background-color: #fff;
    box-shadow: 2px 2px 3px #ccc;
}
.info-right blockquote {
    margin: 0;
    padding: 0;
}
.info-right h2 {
    font-size: 20px;
    color: #333;
    padding: 5px;
}
.info-right h4 {
    color: #333;
    font-size: 16px;
    padding: 2px 0 0 0;
    line-height: 1.6;
}
#footer {
    background-color: #666;
    border-top: 1px solid #ccc;
    padding: 20px;
    text-align: center;
    color: #eee;
}
/*沒有小於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;
    }
    .jumbotron h1 {
        font-size: 30px;
    }
    .jumbotron h4 {
        font-size: 16px;
    }
    .info-content h4 {
        font-size: 16px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
}

/* 中等屏幕(桌面顯示器,大於等於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;
    }
    .jumbotron h1 {
        font-size: 33px;
    }
    .jumbotron h4 {
        font-size: 17px;
    }
    .info-content h4 {
        font-size: 18px;
    }
}

/* 大屏幕(大桌面顯示器,大於等於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;
    }
    .jumbotron h1 {
        font-size: 36px;
    }
    .jumbotron h4 {
        font-size: 18px;
    }
    .info-content h4 {
        font-size: 20px;
    }
}

 

  • 結果以下,大屏幕

 

  • 其餘屏幕以下

 

相關文章
相關標籤/搜索