zoukankan      html  css  js  c++  java
  • flexbox + media query 实现响应式布局

      <style type="text/css">
      *{margin: 0; padding: 0;}
      /*body {
      display: flex;
      align-items: center;
      justify-content: center;
       
      flex-wrap: wrap;
      align-content: center;
      }*/
       
      .row {
      display: flex;
      align-items:stretch;
      flex:auto;
      background-color: red;
      }
       
      .item {
      display: flex;
      height: 150px;
      flex:0 0 33%;
      align-items:center;
      justify-content:center;
      border: 1px solid #000;
      }
       
      @media screen and (min- 1620px) {
      .row {
      flex-direction: row;
      }
      }
       
      @media screen and (min-320px) and (max-500px){
      .row {
      flex-direction: column;
      }
      }
       
      @media screen and (max-320px){
      .row{
      background-color:blue;
      flex-direction: column-reverse
      }
      }
       
      </style>
       
      <div class="row">
      <div class="item">1</div>
      <div class="item">2</div>
      <div class="item">3</div>
      </div>
  • 相关阅读:
    元祖操作
    列表操作
    字符串操作
    zabbix监控脚本
    nginx 使用php-fpm的配置php环境参数
    网卡切换脚本
    mysql数据备份脚本
    docker概念
    网络链路质量监控smokeping
    搭建speedtest
  • 原文地址:https://www.cnblogs.com/xuezizhenchengxuyuan/p/6377951.html
Copyright © 2011-2022 走看看