如果要兼容移动端和web端,可以使用媒体查询基本用法

1、一般常用的尺寸

@media screen and (min-width: 1230px) {}
@media screen and (min-width: 993px) and (max-width:1201px) {}
@media screen and (max-width: 992px) {}
@media screen and (max-width: 768px) {}
@media screen and (max-width: 480px) {}

2、例子

@media screen and (min-width: 768px) {
  .head-content {
    margin-top: 220px;
  }
  .applet-side-title {
    margin-top: 230px;
  }
  .qr .foot_wechat {
    margin: 0 auto;
  }
  .top-bg-images {
    width: 100%;
    background: url('./images/bg-images-web.jpg') no-repeat;
    background-size: 100% 1080px;
    padding-bottom: 255px;
  }
  .applet-side {
    width: 100%;
    background: url('./images/applet-images-web.jpg') no-repeat;
    background-size: 100% 1080px;
  }
  .applet-side-title {
    margin-left: 450px;
  }
  .applet-side-content {
    width: 720px;
    height: 80px;
    border: 1px solid #4887b6;
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    margin-left: 450px;
    .applet-side-images-title {
      display: flex;
      align-items: center;
      padding-left: 50px;
      font-size: 16px;
      color: #000;
      .applet-images-web {
        width: 30px;
        height: 30px;
        margin-right: 20px;
      }
      .applet-images-phone {
        display: none;
      }
      .applet-title {
        margin-right: 20px;
        font-weight: bold;
      }
      .applet-solid {
        display: block;
        height: 30px;
        width: 1px;
        background-color: #4887b6;
        margin-right: 20px;
      }
    }
    .applet-content {
      color: #000;
    }
  }
  .applet-side-content:last-child {
    margin-bottom: 50px;
  }
  .service-platform {
    padding-top: 100px;
    width: 100%;
    background: url('./images/system-images-web.jpg') no-repeat;
    background-size: 100% 1080px;
  }
  .images-title-content {
    margin-top: 100px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    height: 844px;
    .all-system {
      display: flex;
      flex-direction: column;
      align-items: center;
      .system-image-box {
        box-sizing: border-box;
        width: 150px;
        height: 150px;
        border-radius: 50%;
        background-color: #4887b6;
        display: flex;
        align-items: center;
        justify-content: center;
        .system-image {
          width: 84px;
          height: 84px;
        }
      }
      .system-title {
        margin-top: 20px;
        font-size: 18px;
        font-weight: bold;
        color: #000;
        letter-spacing: 2px;
      }
    }
  }
  .content-top {
    position: relative;
    width: 270px;
    height: 280px;
    box-sizing: border-box;
    margin: 80px auto 30px;
    .content-top-content {
      position: relative;
      width: 200px;
      height: 240px;
      padding: 30px 20px 30px;
      font-size: 14px;
      box-shadow: 1px 1px 5px #5c5c5c;
      .content-top-position {
        position: absolute;
        bottom: -25px;
        right: -20px;
        font-size: 27px;
        color: #ffffff;
        box-shadow: 1px 1px 5px #223762;
        background-color: #223762;
        padding: 10px 30px;
      }
    }
    .background-green {
      position: absolute;
      bottom: 0;
      right: 0;
      box-shadow: 1px 1px 5px #278d96;
      background-color: #278d96;
      width: 150px;
      padding: 20px;
    }
  }
  .content-bottom {
    position: relative;
    width: 270px;
    height: 280px;
    box-sizing: border-box;
    margin: 80px auto 30px;
    .content-bottom-content {
      position: relative;
      width: 200px;
      height: 240px;
      padding: 30px 20px 30px;
      font-size: 14px;
      box-shadow: 1px 1px 5px #5c5c5c;
      margin-top: 40px;
      .content-bottom-position {
        position: absolute;
        top: -25px;
        right: -20px;
        font-size: 27px;
        color: #ffffff;
        box-shadow: 1px 1px 5px #223762;
        background-color: #223762;
        padding: 10px 30px;
      }
    }
    .background-green {
      position: absolute;
      top: -40px;
      right: 0;
      box-shadow: 1px 1px 5px #278d96;
      background-color: #278d96;
      width: 150px;
      padding: 20px;
    }
  }
}
@media screen and (max-width: 768px) {
  .container {
    padding-top: 30px;
  }
  .top-bg-images {
    margin-top: 30px;
    width: 100%;
    background: url('./images/bg-images-phone.jpg') no-repeat;
    background-size: cover;
  }
  .qr .foot_wechat {
    margin: 0 auto;
  }
  .applet-side {
    width: 100%;
    background: url('./images/applet-images-phone.jpg') no-repeat;
    background-size: cover;
  }
  .applet-side-content {
    border-radius: 10px;
    background-color: #4887b6;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 30px;
    .applet-side-images-title {
      display: flex;
      align-items: center;
      justify-content: center;
      // flex-direction: column;
      font-size: 16px;
      color: #ffffff;
      .applet-images-phone {
        width: 20px;
        height: 20px;
        margin-top: 10px;
        margin-right: 20px;
      }
      .applet-images-web {
        display: none;
      }
      .applet-title {
        font-weight: bold;
        margin-top: 10px;
      }
      .applet-solid {
        display: none;
      }
    }
    .applet-content {
      color: #ffffff;
      margin-bottom: 10px;
    }
  }
  .service-platform {
    width: 100%;
    background: url('./images/system-images-phone.jpg') no-repeat;
    background-size: 100% 1200px;
  }
  .images-title-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    height: 1134px;
    .all-system {
      display: flex;
      flex-direction: column;
      align-items: center;
      margin: 0 auto;
      margin-top: 20px;
      .system-image-box {
        box-sizing: border-box;
        width: 150px;
        height: 150px;
        border-radius: 50%;
        background-color: #4887b6;
        display: flex;
        align-items: center;
        justify-content: center;
        .system-image {
          width: 84px;
          height: 84px;
        }
      }
      .system-title {
        margin-top: 20px;
        font-size: 18px;
        font-weight: bold;
        color: #000;
        letter-spacing: 2px;
      }
    }
    .all-system:last-child {
      .system-title {
        margin-bottom: 50px;
        // color: #ffffff;
      }
    }
  }
  .content-bottom,
  .content-top {
    position: relative;
    width: 200px;
    height: 280px;
    box-sizing: border-box;
    margin: 20px auto 30px;
    .content-bottom-content,
    .content-top-content {
      position: relative;
      width: 200px;
      height: 240px;
      padding: 30px 20px 30px;
      font-size: 14px;
      box-shadow: 1px 1px 5px #5c5c5c;
      .content-bottom-position,
      .content-top-position {
        position: absolute;
        top: -25px;
        right: 15px;
        font-size: 27px;
        color: #ffffff;
        box-shadow: 1px 1px 5px #223762;
        background-color: #223762;
        padding: 10px 30px;
      }
    }
    .background-green {
      display: none;
    }
  }
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值