【问题标题】:How I can positionning my Image in such a way that the Image dont exceed my with screen?如何以图像不超过我的屏幕的方式定位我的图像?
【发布时间】:2022-12-14 08:39:32
【问题描述】:

这是我使用此 css 代码时的内容:

  .circleImage {
    position: absolute;
    width: 40%;
    left: 300px;
    top: 570px;
  }

我希望的结果在这里:

我尝试 fixed 和 sticky 的位置类型,我没有超出我的屏幕但 fixed 或 sticky 与我的结果不符

感谢那些花时间帮助我的人

【问题讨论】:

  • 添加溢出:隐藏在图像父级上

标签: css


【解决方案1】:

只需使用响应单元来定位图像。

.circleImage {
    position: absolute;
    width: 40%;
    left: 30%;
    top: 30vh;
  }
<img class="circleImage" src="https://www.pikpng.com/pngl/b/390-3904056_round-profile-round-profile-clipart.png">

【讨论】:

    猜你喜欢
    • 2017-05-01
    • 2013-07-24
    • 2022-07-26
    • 1970-01-01
    • 2016-09-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多