我对响应式CSS设计相当陌生,而且我无法获得一个非常简单的工作。 我有一个约1200px宽的DIV。我希望此div在iPad或智能手机上查看时缩小到最大屏幕尺寸。如何将整个网页缩小到ipad或手机尺寸
例如,当您访问智能手机上的非响应式网站时,您会看到整个网站缩小到电话屏幕上的一个小尺寸。这实际上是不响应,但不知何故,我不能重现降比效果:
我的div:
<div id="app">
<div id="screen">This is my screen</div>
</div>
我的CSS:
html,body {
margin:0px;
padding:0px;
}
#app {
width:1200px;
height:800px;
background-color:#CCCCCC;
overflow:auto;
}
#screen {
width:800px;
height:400px;
margin: 0 auto;
background-color:#ABABAB;
}
/* this is only for large screens: scale the background up to fill the entire screen */
@media only screen and (min-width : 1200px) {
#app {
width:100%;
height:100%;
background-color:#999999;
}
}
JSFiddle这里。如何在小屏幕上显示缩小的div?
请不要让可怜的移动用户下载一张1200像素x 800像素的图像,如果有的话 – Leo
我知道这并不理想,但我真正需要的只是将网站缩小一点点,所以它非常适合iPad屏幕。 1200像素仅比iPad的1024像素稍大。 – Kokodoko