首页 > 其他 > 详细

响应式,让屏幕自适应

时间:2015-03-12 15:20:48      阅读:191      评论:0      收藏:0      [点我收藏+]

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">

<title>响应式</title>

<style>

body{

margin:0;

color:#FFF;

}

.clas {width: 1000px; margin:0 auto; background:#600;}

@media screen and (max-width:980px) {

.clas {width: 500px; margin:0 auto; background:#000;}


}

@media screen and (max-width:680px) {

.clas{

width:300px;

background:#F00;

margin:0 auto;

}

}

@media screen and (max-width:320px) {

.clas{

width:200px;

background:#30F;

margin:0 auto;

}

}

</style>

</head>


<body>

<div class="clas">

<p>你可以缩小浏览器看看</p>

<p>你可以缩小浏览器看看</p><p>你可以缩小浏览器看看</p><p>你可以缩小浏览器看看</p><p>你可以缩小浏览器看看</p><p>你可以缩小浏览器看看</p><p>你可以缩小浏览器看看</p><p>你可以缩小浏览器看看</p><p>你可以缩小浏览器看看</p><p>你可以缩小浏览器看看</p><p>你可以缩小浏览器看看</p><p>你可以缩小浏览器看看</p>

</div>

</body>

</html>




小贾作品

本文出自 “贾小仙” 博客,请务必保留此出处http://hackerxian.blog.51cto.com/9240575/1619645

响应式,让屏幕自适应

原文:http://hackerxian.blog.51cto.com/9240575/1619645

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!