用流布局作响应式

该博客介绍了如何使用Flex布局来创建响应式设计。通过调整不同屏幕尺寸下的媒体查询,实现了在大屏设备上显示为两列,在小屏设备上显示为一列的布局效果。内容包括设置元素的margin、padding、flex属性,以及图片、标题和链接的样式。
摘要由CSDN通过智能技术生成

 

 *{margin: 0px;padding: 0px}

        .wrap{width: 80%;margin: 0 auto;}

        .wrap h1{margin: 30px 0px ;text-align: center;}

        .item{display: flex;}

        .item div{flex: 1;padding: 20px 30px;}

        .item div img {width: 100%;height: auto;}

        .item div h2{margin: 30px 0px ;}

        .item div a {display: block;color: orange;text-decoration: none;margin: 20px 0px;}

        @media all and (max-width:1000px){}

        @media all and (max-width:992px){

            .wrap{flex-flow: row wrap;}

            .wrap .item {flex: 0 0 auto;width: 50%;}

        }

        @media all and (max-width:768px){

            .wrap{flex-flow: column;}

            .wrap .item {flex: 0 0 auto;width: 80%;margin: 20px auto;}

        }

    </style>

</head>

<body>

    <div class="wrap">

        <h1>Pprtfolio...</h1>

        <div class="item">

            <div>

                <img src="../image/a.png">

                <h2></h2>

                <p>style="color:red;font-weight:600">

                ef="http://developer.baidu.com/map/index.php?title=jspopular/guide/introduction" style="color:#2f83c7" target="_blank

                   ="http://lbsyun.baidu.com/apiconsole/key?application=key</p>

                <a href="#">apiconsole</a>

            </div>

            <div>

                <img src="../image/b.png">

                <h2></h2>

                <p>style="color:red;font-weight:600">

                ef="http://developer.baidu.com/map/index.php?title=jspopular/guide/introduction" style="color:#2f83c7" target="_blank

                   ="http://lbsyun.baidu.com/apiconsole/key?application=key</p>

                <a href="#">apiconsole</a>

            </div>

            <div>

                <img src="../image/c.png">

                <h2></h2>

                <p>style="color:red;font-weight:600">

                ef="http://developer.baidu.com/map/index.php?title=jspopular/guide/introduction" style="color:#2f83c7" target="_blank

                   ="http://lbsyun.baidu.com/apiconsole/key?application=key</p>

                <a href="#">apiconsole</a>

            </div>

           

        </div>

        <div class="item">

            <div>

                <img src="../image/a.png">

                <h2></h2>

                <p>style="color:red;font-weight:600">

                ef="http://developer.baidu.com/map/index.php?title=jspopular/guide/introduction" style="color:#2f83c7" target="_blank

                   ="http://lbsyun.baidu.com/apiconsole/key?application=key</p>

                <a href="#">apiconsole</a>

            </div>

            <div>

                <img src="../image/b.png">

                <h2></h2>

                <p>style="color:red;font-weight:600">

                ef="http://developer.baidu.com/map/index.php?title=jspopular/guide/introduction" style="color:#2f83c7" target="_blank

                   ="http://lbsyun.baidu.com/apiconsole/key?application=key</p>

                <a href="#">apiconsole</a>

            </div>

            <div>

                <img src="../image/c.png">

                <h2></h2>

                <p>style="color:red;font-weight:600">

                ef="http://developer.baidu.com/map/index.php?title=jspopular/guide/introduction" style="color:#2f83c7" target="_blank

                   ="http://lbsyun.baidu.com/apiconsole/key?application=key</p>

                <a href="#">apiconsole</a>

            </div>

    </div>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

孙璐_iLu

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值