响应式布局自适应,适应不同大小浏览器,分辨率

在这里插入图片描述在这里插入图片描述
在这里插入图片描述在这里插入图片描述在这里插入图片描述

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      * {
        padding: 0;
        margin: 0;
      }
      @media screen and (max-device-width: 1280px) {
        .one {
          background: url(2.jpg);
          width: 300px;
          height: 332px;
        }
      }
      /* 大于1920等于分辨率会显示 */
      @media screen and (min-device-width: 1400px) {
        .one {
          background: url(2.jpg);
          width: 100%;
          height: 500px;
        }
      }

      /* 屏幕必须小于等于300 */
      @media screen and (max-width: 300px) {
        .two {
          background-color: lightblue;
          width: 300px;
          height: 300px;
        }
      }
      @media screen and (min-width: 300px) {
        .two {
          background-color: orange;
          width: 300px;
          height: 300px;
        }
      }
      /* 屏幕不能超过800 */
      @media screen and (min-width: 500px) {
        .two {
          background-color: lightblue;
          width: 300px;
          height: 300px;
        }
        .three {
          background-color: pink;
          width: 300px;
          height: 300px;
        }
      }
      /* img {
        width: auto;
        height: auto;
        max-width: 100%;
        max-height: 100%;
        
      } */
      /* img {
        width: 100%;
        height: 100%;
      } */
    </style>
  </head>
  <body>
    <div class="one">
      <!-- <img src="2.jpg" /> -->
      <!-- 你好世界 -->
    </div>
    <div class="two"></div>
    <div class="three"></div>
  </body>
</html>

pc端常用电脑屏幕 ((响应式PC端媒体查询)电脑屏幕分辨率尺寸大全)
https://www.cnblogs.com/shimily/articles/8032450.html

https://blog.csdn.net/weixin_33769125/article/details/89664551

https://blog.csdn.net/weixin_33726943/article/details/93532819

https://www.bilibili.com/video/BV1Ny4y147g9?p=2&spm_id_from=pageDriver

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值