>  기사  >  웹 프론트엔드  >  부트스트랩 그리드 시스템(자세한 튜토리얼)

부트스트랩 그리드 시스템(자세한 튜토리얼)

亚连
亚连원래의
2018-06-19 18:00:141403검색

이제 반응형 프레임워크인 부트스트랩 그리드 시스템의 예를 공유하겠습니다. 이는 좋은 참고 가치가 있으며 모든 사람에게 도움이 되기를 바랍니다.

예는 다음과 같습니다.

<!DOCTYPE html>
<html>
<head lang="en">
 <meta charset="UTF-8">
 <title></title>
 <meta name="viewport" content="width=device-width, initial-scale=1">
 <link rel="stylesheet" href="css/bootstrap.min.css" rel="external nofollow" />
 <script language="JavaScript" src="js/jquery-3.js"></script>
 <style type="text/css">
  *{
   top: 0px;
   padding: 0px;
   text-decoration: none;
   list-style-type: none;
  }

  .top-styl{
   height: 50px;
   border: 1px solid red;
   background-color: #000000;
  }
  .img-styl{
   width: 174px;
   height: 50px;
   background: url("imges/logo.png")no-repeat 0px 3px;
   background-size: contain;
   float: left;
  }
  .sousuo-styl{
   width: 187px;
   float: left;
  }
  .top-search-input{
   width: 150px;
   padding: 0 5px;
   height: 30px;
   border: 0;
   background: #363636;
   float: left;
   color: #ccc;
  }
  .top-search-submit{
   width: 30px;
   height: 30px;
   border: 0;
   background: green url("imges/zoom.gif")center center no-repeat;
   float: left;
   cursor: pointer;          //光标指针
  }
  .dao-styll{
   float: left;
   font-size: 16px;
   width: 329px;
   margin-left: 33px;
   margin-top: 11px;

  }
  .dao-styll li{
   float: left;
   position: relative;      //相对定位
   text-align: center;
   padding: 0 7px;
  }
  .dao-styll >li:hover{
   background-color: #999;
  }
  .dao-styll >li >a{
   color: #FFF;
   width: 100%;
   height: 34px;
   text-decoration: none;    //取消下划线
  }
  .dz-styl{
   float: right;
   margin: -19px -9px 6px 21px;
  }
  .imgs-styl{
   padding: 11px 0px 0px 114px;
   float: right;
   margin: 0px -98px -3px 8px;
  }
  .green-styl{
   color: green;
  }
  .zc-styl{
   color: white;
  }
  a{
   text-decoration: none;
  }
 </style>
</head>
<body>
 <p class="container-fluid">           //fluid表示用 百分比
  <p class="row">               //row 行
   <p class="top-styl col-md-12">        //col-md-12 每行桌面占12列
    <p class="row">
     <p class=" col-md-offset-1 col-md-9">   //col-md-offset-1 列偏移1列
      <p class="row">
      <p class="col-md-3 col-xs-4">
       <p class="img-styl"></p>
      </p>
       <p class="col-md-3 ">
        <p class="sousuo-styl" style="padding-left: 7px; margin: 8px auto;">
         <input class="top-search-input" value="" type="text"><input
          class="top-search-submit" type="submit" value="" />
        </p>
       </p>
       <p class="col-md-4 hidden-xs" style="padding: 0px">
        <ul class="dao-styll">
         <li class=""><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >风格</a>
         </li>
         <li class=""><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >造型师</a></li>
         <li class=""><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >众分享</a>
         </li>
         <li class=""><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >我的美丽衣橱</a></li>
        </ul>
       </p>
       <p class="col-md-2">
        <p class="imgs-styl">
         <img src="imges/sina.gif">
        </p>
        <p class="dz-styl">
         <span><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="green-styl">登录</a> | </span><span>
         <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="zc-styl">注册</a></span>
        </p>
       </p>


      </p>
     </p>
    </p>
   </p>
  </p>

 <p class="row">
    <p class="visible-md"><h1>当前为桌面显示</h1></p>   //visible默认占满整行 
    <p class="visible-sm"><h1>当前为平面显示</h1></p>
    <p class="visible-xs"><h1>当前为手机显示</h1></p>
  </p>
 </p>
</body>
</html>

효과 표시 사진:

위 내용은 모두에게 도움이 되기를 바랍니다. 미래.

관련 기사:

casperjs 및 like.js를 사용하여 픽셀 비교를 구현하는 방법(자세한 튜토리얼)

async-validator를 사용하여 Form 구성 요소를 작성하는 방법(자세한 튜토리얼)

빠른 정렬 구현 방법 JavaScript 사용(자세한 튜토리얼) 튜토리얼)

위 내용은 부트스트랩 그리드 시스템(자세한 튜토리얼)의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.