响应式布局

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width,initial-scale=1.0"/>
        <title>响应式布局</title>
        <style type="text/css">
            #div0{
                width: 100px;
                height: 200px;
            }
            @media screen and (min-device-width:200px) and (max-device-width:300px){
                #div0{
                    background-color: red;
                }
            }
            @media screen and (min-device-width:301px) and (max-device-width:400px){
                #div0{
                    background-color: green;
                }
            }
            @media screen and (min-device-width:401px) and (max-device-width:500px){
                #div0{
                    background-color: yellow;
                }
            }
        </style>
    </head>
    <body>
        <div id="div0">
            
        </div>
    </body>
</html>

image.png

media引入其他方式(一)

image.png

media引入其他方式(二)

image.png

弹性盒子

image.png

image.png

image.png

image.png

image.png
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容