溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

web開發中如何實現響應式布局

發布時間:2021-09-14 11:01:41 來源:億速云 閱讀:171 作者:小新 欄目:web開發

這篇文章給大家分享的是有關web開發中如何實現響應式布局的內容。小編覺得挺實用的,因此分享給大家做個參考,一起跟隨小編過來看看吧。

響應式布局

響應式布局在面對不同分辨率設備靈活性強,在平時的網頁設計中基本上都要用到響應式布局設計,它給我們提供了良好的用戶瀏覽頁面,能帶給我們更好的客戶體驗,下面給大家分享下我做的一個簡單的響應式的布局:

web開發中如何實現響應式布局

web開發中如何實現響應式布局

不同的頁面會適用不同大小瀏覽器頁面,它會隨著分辨率的變化而變化。代碼展示如下:

<!DOCTYPE html>    
<html>    
<head>    
<meta charset="utf-8" />    
<title></title>    
<style>    
  p{    
    font-size: 12px;    
  }    
  header{    
    width: 100%;    
  }    
  header img{    
    width: 100%;    
  }    
  @media (min-width: 1300px) and (max-width:1400px) {    
    #left{    
      float: left;    
      width: 30%;    
      margin: 0px 50px;    
    }    
    #left #logo-bg{    
      margin: 10% 10%;    
      width: 80%;    
      position: relative;    
    }    
    #left #logo{    
      float: left;    
      width: 12%;    
      position: absolute;    
      left: 13%;    
      top: 230px;    
    }    
    #left p{    
      margin-bottom: -20px;    
    }    
    #left p,h5{    
      text-align: center;    
      color: red;    
    }    
    #right{    
      float: left;    
      width: 60%;    
      margin: 15% 0px;    
    }    
    #right h3{    
      text-align: center;    
    }    
    #right fieldset{    
      text-align: center;    
      border-left: none;    
      border-right: none;    
      border-bottom: none;    
    }    
    #right fieldset legend{    
      padding: 0px 20px;    
    }    
    #fen{    
      width: 100%;    
      -webkit-column-count: 6;    
      -moz-column-count: 6;    
      -o-column-count: 6;    
      -ms-column-count: 6;    
      column-count: 6;    
      -webkit-column-gap: 1em;    
      -moz-column-gap: 1em;    
      -o-column-gap: 1em;    
      -ms-column-gap: 1em;    
      column-gap: 1em;    
    }    
    #fen img{    
      width: 100%;    
      border-radius: 10px 10px 10px 10px;    
    }    
    #fen p,h5{    
      text-align: center;    
      color: red;    
    }    
    #fen p{    
      margin-bottom: -20px;    
    }    
    #di p{    
      text-align: center;    
    }    
    #di p span{    
       color: red;    
    }    
  }    
  @media (min-width: 1000px) and (max-width:1300px){    
    #left{    
      float: left;    
      width: 30%;    
      margin: 0px 50px;    
    }    
    #left #logo-bg{    
      margin: 10% 10%;    
      width: 80%;    
      position: relative;    
    }    
    #left #logo{    
      width: 12%;    
      position: absolute;    
      left: 14%;    
      top: 190px;    
    }    
    #left p{    
      margin-bottom: -20px;    
    }    
    #left p,h5{    
      text-align: center;    
      color: red;    
    }    
    #right{    
      float: left;    
      width: 60%;    
      margin: 15% 0px;    
    }    
    #right h3{    
      text-align: center;    
    }    
    #right fieldset{    
      text-align: center;    
      border-left: none;    
      border-right: none;    
      border-bottom: none;    
    }    
    #right fieldset legend{    
      padding: 0px 20px;    
    }    
    #fen{    
      width: 100%;    
      -webkit-column-count: 3;    
      -moz-column-count: 3;    
      -o-column-count: 3;    
      -ms-column-count: 3;    
      column-count: 3;    
      -webkit-column-gap: 1em;    
      -moz-column-gap: 1em;    
      -o-column-gap: 1em;    
      -ms-column-gap: 1em;    
      column-gap: 1em;    
    }    
    #fen img{    
        width: 100%;    
        border-radius: 10px 10px 10px 10px;    
    }    
    #fen p,h5{    
        text-align: center;    
        color: red;    
      }    
    #fen p{    
        margin-bottom: -20px;    
    }    
    #di p{    
      text-align: center;    
    }    
    #di p span{    
      color: red;    
    }    
  }    
</style>    
</head>    
<body>    
  <header>    
    <img src="img/rag.png" />    
  </header>    
  <aside id="left">    
    <img src="img/logo-bg.png" id="logo-bg"/>    
    <img src="img/logo.png" id="logo" />    
    <hr />    
    <p>THE</p>    
    <h5>WEBLOCUE</h5>    
    <hr />    
    <p>THE</p>    
    <h5>WEBLOCUE</h5>    
    <hr />    
    <p>THE</p>    
    <h5>WEBLOCUE</h5>    
    <hr />    
  </aside>    
  <article id="right">    
    <h3>“Give me problems, give me work.”</h3>    
    <p>In the year 1878 I took dogree of Doctor of Medicline of the Unibertive of the London and problems to Netbody to go through the course,In the year 1878 I took dogree of Doctor of Medicline of the Unibertive of the London and problems to Netbody to go through the course,In the year 1878 I took dogree of Doctor of Medicline of the Unibertive of the London and problems to Netbody to go through the course.</p>    
    <p>In the year 1878 I took dogree of Doctor of Medicline of the Unibertive of the London and problems to Netbody to go through the course,In the year 1878 I took dogree of Doctor of Medicline of the Unibertive of the London and problems to Netbody to go through the course,In the year 1878 I took dogree of Doctor of Medicline of the Unibertive of the London and problems to Netbody to go through the course.</p>    
    <fieldset><legend>victors</legend></fieldset>    
    <div id="fen">    
      <img src="img/1.jpg" />    
      <p>SETCOME</p>    
      <h5>HOLEMES</h5>    
      <img src="img/2.jpg" />    
      <p>SETCOME</p>    
      <h5>HOLEMES</h5>    
      <img src="img/3.jpg" />    
      <p>SETCOME</p>    
      <h5>HOLEMES</h5>    
      <img src="img/4.jpg" />    
      <p>SETCOME</p>    
      <h5>HOLEMES</h5>    
      <img src="img/5.jpg" />    
      <p>SETCOME</p>    
      <h5>HOLEMES</h5>    
      <img src="img/6.jpg" />    
      <p>SETCOME</p>    
      <h5>HOLEMES</h5>    
    </div>    
    <fieldset><legend>*</legend></fieldset>    
    <div id="di">    
      <p>In the year 1878 I took <span>Suing table</span> dogree of Doctor</p>    
      <p>What the year 2016 I took dogree <span>Ruing roid</span> of Doctor</p>    
    </div>    
  </article>    
</body>    
</html>

感謝各位的閱讀!關于“web開發中如何實現響應式布局”這篇文章就分享到這里了,希望以上內容可以對大家有一定的幫助,讓大家可以學到更多知識,如果覺得文章不錯,可以把它分享出去讓更多的人看到吧!

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

亚洲午夜精品一区二区_中文无码日韩欧免_久久香蕉精品视频_欧美主播一区二区三区美女