首頁 > web前端 > js教程 > 主體

Bootstrap專案實戰之子欄位資訊內容_javascript技巧

WBOY
發布: 2016-05-16 15:04:01
原創
1280 人瀏覽過

本文我們製作一下子欄位資訊內容,供大家參考,具體內容如下

Google瀏覽器解析的順序調整,需要全部載入後執行

$(window).load(function() {
  $('.text').eq(0).css('margin-top', ($('.auto').eq(0).height() - $('.text').eq(0).height()) / 2 + 'px');
}); 
登入後複製

附註:對於 Firefox 瀏覽器,可以按 Ctrl+Shift+M,調整行動端尺寸。
子欄目標題

<div class="jumbotron">
  <div class="container">
    <hgroup>
      <h1>资讯</h1>
      <h4>企业内训的最新动态、资源等...</h4>
    </hgroup>
  </div>
</div>
登入後複製

欄位 CSS

.jumbotron {
  margin: 50px 0 0 0;
  padding: 60px 0;
  background: #ccc url(../img/bg.jpg);
  color: #ccc;
}
.jumbotron h1 {
  font-size: 26px;//768,30; 992,33; 1200,36;
  padding: 0 0 0 20px;
}
.jumbotron h4 {
  font-size: 16px;//768,16; 992,17; 1200,18
  padding: 0 0 0 20px;
}
登入後複製

資訊內容

<div id="information">
  <div class="container">
    <div class="row">
      <div class="col-md-8 info-left">
        <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="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>
      </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="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>

登入後複製

資訊內容 CSS

#information {
  padding: 40px 0;
  background: #eee;
}
.info-right {
  background-color: #fff;
  box-shadow: 2px 2px 3px #ccc;
}
.info-right blockquote {
  padding: 0;
  margin: 0;
}
.info-right h2 {
  font-size: 20px;
  padding: 5px;
}
.info-right h4 {
  line-height: 1.6;
}
.info-content {
  background-color: #fff;
  box-shadow: 2px 2px 3px #ccc;
  margin: 0 0 20px 0;
}
.info-content img {
  margin: 12px 0;
}
.info-content h4 {
  font-size: 14px;//768,16; 992,18; 1200,20;
  padding: 2px 0 0 0;
}
.info-content p {
  line-height: 1.6;
  color: #666;
}
登入後複製

對於.info-content h4,在中螢幕和大螢幕需要保持一行。

.info-content h4 {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

登入後複製

更多內容可以參考:Bootstrap學習教學

以上就是Bootstrap製作子欄位資訊內容的想關程式碼,希望大家喜歡。

來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!