当我们要放入的图片大于div标签规定的大小时候,就要用到这里介绍的overflow,

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div style="height: 200px;width: 300px;overflow: auto">
        <img src="1.jpg">
    </div>

    <div style="height: 200px;width: 300px;overflow: hidden">
        <img src="1.jpg">
    </div>
</body>
</html>

auto型的有滚动条;

hidden型的只显示部分


CSS基础(10.overflow)

相关文章:

  • 2021-04-06
  • 2022-03-07
  • 2022-01-17
  • 2021-11-08
猜你喜欢
  • 2021-06-01
  • 2022-12-23
  • 2021-10-21
  • 2021-09-26
  • 2021-07-11
相关资源
相似解决方案