有没有办法在不改变圆圈大小的情况下调整圆圈内图像的大小?

问题描述 投票:0回答:1

我正在尝试调整圆圈内图像的大小,但我只能同时更改图像和圆圈的大小。我假设这是因为边界半径,但我不确定还能做什么。

我正在尝试扭转这个:

enter image description here

进入此:

enter image description here

.Nova {
  width: 400px;
  height: 400px;
  border-radius: 50%;
  overflow: hidden;
  object-position: 0px 0px;
}
<img src="https://i.sstatic.net/xFBKyZNi.png" class="Nova" />

html css image object-fit
1个回答
0
投票

类似这样的东西(但您要么需要更高分辨率的图像,要么使用 SVG,这样缩放时质量不会下降)

.img-wrapper {
  width: 400px;
  height: 400px;
  border-radius: 50%;
  overflow: hidden;
  object-position: 0px 0px;
}

.Nova {
    position: relative;
    zoom: 2;
    right: 100%;
}
<div class="img-wrapper">
    <img src="https://i.sstatic.net/xFBKyZNi.png" class="Nova" />
</div>

© www.soinside.com 2019 - 2024. All rights reserved.