黑松山资源网 Design By www.paidiu.com
响应式布局
响应式布局在面对不同分辨率设备灵活性强,在平时的网页设计中基本上都要用到响应式布局设计,它给我们提供了良好的用户浏览页面,能带给我们更好的客户体验,下面给大家分享下我做的一个简单的响应式的布局:
不同的页面会适用不同大小浏览器页面,它会随着分辨率的变化而变化。代码展示如下:
XML/HTML Code复制内容到剪贴板- <!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,h4{
- text-align: center;
- color: red;
- }
- #right{
- float: left;
- width: 60%;
- margin: 15% 0px;
- }
- #right h2{
- 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,h4{
- 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,h4{
- text-align: center;
- color: red;
- }
- #right{
- float: left;
- width: 60%;
- margin: 15% 0px;
- }
- #right h2{
- 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,h4{
- 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>
- <h4>WEBLOCUE</h4>
- <hr />
- <p>THE</p>
- <h4>WEBLOCUE</h4>
- <hr />
- <p>THE</p>
- <h4>WEBLOCUE</h4>
- <hr />
- </aside>
- <article id="right">
- <h2>“Give me problems, give me work.”</h2>
- <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>
- <h4>HOLEMES</h4>
- <img src="img/2.jpg" />
- <p>SETCOME</p>
- <h4>HOLEMES</h4>
- <img src="img/3.jpg" />
- <p>SETCOME</p>
- <h4>HOLEMES</h4>
- <img src="img/4.jpg" />
- <p>SETCOME</p>
- <h4>HOLEMES</h4>
- <img src="img/5.jpg" />
- <p>SETCOME</p>
- <h4>HOLEMES</h4>
- <img src="img/6.jpg" />
- <p>SETCOME</p>
- <h4>HOLEMES</h4>
- </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>
做的不够严谨,因为时间问题,请见谅。
以上这篇响应式布局的简单案例就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。
原文地址:http://www.cnblogs.com/duzheqiang/p/5666465.html
黑松山资源网 Design By www.paidiu.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
黑松山资源网 Design By www.paidiu.com
暂无评论...
更新日志
2024年11月15日
2024年11月15日
- 谭咏麟《20世纪中华歌坛名人百集珍藏版》[WAV+CUE][1G]
- 炉石传说40轮盘术最新卡组代码在哪找 标准40轮盘术卡组代码分享
- 炉石传说亲王贼怎么玩 2024亲王贼最新卡组代码分享
- 炉石传说30.6.2补丁后有什么卡组 30.6.2最强卡组最新推荐
- 模拟之声慢刻CD《蔡琴名曲回顾遇听》[原抓WAV+CUE]
- BruceLiu-WAVES(MusicbySatie)(2024)2CD[24Bit-96kHz]FLAC
- KonstantinKrimmel-MythosSchubertLoewe(2024)[24Bit-96kHz]FLAC
- 2024雷蛇高校挑战赛 嘤式分解助力收官之战
- 海信发布110吋世俱杯官方定制AI电视 引领智能观赛
- 海信发布27英寸显示器大圣G5 Pro:采用自研超解析芯片、友达原厂模组
- 蔡琴《机遇》1:1母盘直刻日本头版[WAV分轨][1.1G]
- 陈百强《与你几分钟的约会》XRCD+SHMCD限量编号版[低速原抓WAV+CUE][994M]
- 陈洁丽《监听王NO.1 》示范级发烧天碟[WAV+分轨][1.1G]
- 单色凌.2014-小岁月太着急【海蝶】【WAV+CUE】
- 陈淑桦.1988-抱紧我HOLD.ME.NOW【EMI百代】【WAV+CUE】