关于HTML,css3自适应屏幕,自适应宽度
2015-08-18 00:00
666 查看
摘要: 关于HTML,css3自适应屏幕,自适应宽度
HTML结构代码:
要是刚好在那个宽度上,如:屏幕宽度900,刚好
@media screen and (min-width:1080px){ .box{ width: 1080px;}.content{width: 1040px;} .img{height:180px;} .img{font-size: 48px;line-height: 180px;} .title{font-size: 46px;line-height: 100px;} .detail{font-size: 20px;} } @media screen and (min-width: 900px) and (max-width: 1079px) { .box{ width: 900px; }.content{width: 860px;} .img{height:160px;} .img{font-size: 40px;line-height: 160px;} .title{font-size: 38px;line-height: 80px;} .detail{font-size: 17px;} } @media screen and (min-width: 768px) and (max-width: 899px) { .box{ width: 768px; }.content{width: 728px;} .img{height:140px;} .img{font-size: 32px;line-height: 140px;} .title{font-size: 30px;line-height: 60px;} .detail{font-size: 14px;} } @media only screen and (min-width: 480px) and (max-width: 767px){ .box{ width: 480px; }.content{width: 440px; } .img{height:98px;} .img{font-size: 24px;line-height: 100px;} .title{font-size: 22px;line-height: 40px;} .detail{font-size: 11px;} } @media only screen and (max-width: 479px) { .box{ width: 300px; }.content{width: 300px;} .img{height:60px;} .img{font-size: 16px;line-height: 60px;} .title{font-size: 14px;line-height: 20px;} .detail{font-size: 8px;} }
HTML结构代码:
要是刚好在那个宽度上,如:屏幕宽度900,刚好
相关文章推荐
- Web布局连载——两栏固定布局(五)
- [div+css]晒晒最新制作专题推广页模板
- 纯CSS制作的新闻网站中的文章列表
- 10条影响CSS渲染速度的写法与使用建议第1/3页
- BS项目中的CSS架构_仅加载自己需要的CSS
- 很不错的 CSS Hack 又学了一招
- 发一个css比较清爽的写法
- CSS expression控制图片自动缩放效果代码[兼容 IE,Firefox]
- css布局网页水平居中常用方法
- CSS经典技巧十则第1/2页
- css 兼容性问题this.style.cursor=''hand''
- IE6不能正常解析CSS文件问题的解决方法及原因分析
- 欲练CSS ,必先解决IE的一些细节分析
- CSS文字截取功能实现代码
- 支持IE6 IE7 Firefox 的纯CSS的下拉菜单
- 不同版本IE使用不同css(css条件注释语句用法)
- css类选择器的使用方法详解
- css文本框与按钮美化效果代码
- 解决ie动态修改link样式,import css不刷新的问题
- 用css filter做鼠标滑过图片效果