自适应HTML页面源码
来源:互联网 发布:仙逆和凡人知乎 编辑:程序博客网 时间:2024/06/06 03:20
之前做一个简单的界面,需要自适应界面大小,下面是网上找的一个demo,不需要任何依赖文件就能跑的。
<!doctype html><html lang="en"><head><meta charset="utf-8"><!-- viewport meta to reset iPhone inital scale --><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Demo: Responsive Design in 3 Steps</title><!-- css3-mediaqueries.js for IE8 or older --><!--[if lt IE 9]><script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"></script><![endif]--><style type="text/css">body {font: 1em/150% Arial, Helvetica, sans-serif;}a {color: #669;text-decoration: none;}a:hover {text-decoration: underline;}h1 {font: bold 36px/100% Arial, Helvetica, sans-serif;}/************************************************************************************STRUCTURE*************************************************************************************/#pagewrap {padding: 5px;width: 960px;margin: 20px auto;}#header {height: 180px;}#content {width: 600px;float: left;}#sidebar {width: 300px;float: right;}#footer {clear: both;}/************************************************************************************MEDIA QUERIES*************************************************************************************//* for 980px or less */@media screen and (max-width: 980px) {#pagewrap {width: 94%;}#content {width: 65%;}#sidebar {width: 30%;}}/* for 700px or less */@media screen and (max-width: 700px) {#content {width: auto;float: none;}#sidebar {width: auto;float: none;}}/* for 480px or less */@media screen and (max-width: 480px) {#header {height: auto;}h1 {font-size: 24px;}#sidebar {display: none;}}/* border & guideline (you can ignore these) */#content {background: #f8f8f8;}#sidebar {background: #f0efef;}#header, #content, #sidebar {margin-bottom: 5px;}#pagewrap, #header, #content, #sidebar, #footer {border: solid 1px #ccc;}</style></head><body><div id="pagewrap"><div id="header"><h1>Header</h1><p>Tutorial by <a href="http://webdesignerwall.com">Web Designer Wall</a> (read <a href="http://webdesignerwall.com/tutorials/responsive-design-in-3-steps">related article</a>)</p></div><div id="content"><h2>Content</h2><p>text</p><p>text</p><p>text</p><p>text</p><p>text</p><p>text</p><p>text</p><p>text</p><p>text</p><p>text</p></div><div id="sidebar"><h3>Sidebar</h3><p>text</p><p>text</p></div><div id="footer"><h4>Footer</h4></div></div></body></html>
附上原网页:http://xinyo.org/archives/62104/
阅读全文
1 0
- 自适应HTML页面源码
- html页面高度自适应
- HTML自适应手机页面
- html页面图片和文字实现自适应
- html和css自适应页面原理!
- HTML页面自适应宽度的table(表格)
- html自适应页面上下左右分栏的处理技巧
- HTML页面分两栏,左右栏个自适应相…
- 如何设置HTML页面自适应宽度的table(表格)
- 如何设置HTML页面自适应宽度的table(表格)
- html pc、手机、微信端自适应,app推广下载页面
- pc移动端自适应布局html页面(二)
- 页面自适应
- 页面自适应
- 页面自适应
- C#获取页面的HTML源码
- 保存HTML页面源码至文件
- Selenium模拟浏览器下载页面html源码
- python学习(一)turtle画图
- NRF24L01的地址
- 洛谷P2888 [USACO07NOV]牛栏Cow Hurdles
- TLS——安全传输层协议
- Protege使用教程
- 自适应HTML页面源码
- 吐血精验
- 内存分配的一些事
- Minimizing Maximizer UVA
- git branch -r 显示的不是最新的远程分支列表
- leetcode222. Count Complete Tree Nodes
- TLS—对SSL的改善
- kubernetes Node的隔离与恢复
- Centos修改root用户密码