<!DOCTYPE HTML><HTML><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8" /><Metaname= "Viewport"content= "Width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/><title>Media Query Demos "CSS3 self-adapting phone screen"</title><styletype= "Text/css">. Wrapper{Border:Solid 1px #666;padding:5px 10px;margin:40px;}. Viewing-area span{Color:#666;Display:None;}/*Max-width*/@media screen and (max-width:600px){. One {background:#F9C; }span.lt600{Display:Inline-block; }}/*Min-width*/@media screen and (min-width:900px){. Both {background:#F90; }span.gt900{Display:Inline-block; }}/*Min-width & Max-width*/@media screen and (min-width:600px) and (max-width:900px){. Three {background:#9CF; }span.bt600-900{Display:Inline-block; }}/*Max Device Width*/@media screen and (max-device-width:480px){. iphone {background:#ccc; }}</style></Head><Body> <Divclass= "wrapper One">This box turns pink if the viewable area is less than 600px</Div> <Divclass= "wrapper ">This box will turn orange if the viewable area is less than 900px</Div> <Divclass= "wrapper three">This box will turn blue if the viewable area is 600px~900px</Div> </Body></HTML>
CSS3 self-adapting phone screen
http://hi.baidu.com/58zhongguo/item/c4da7bd761d22bc71a72b4d0?qq-pf-to=pcqq.c2c