gpt4 book ai didi

html - 裁剪边界半径非常大的图像

转载 作者:太空宇宙 更新时间:2023-11-03 20:10:14 26 4
gpt4 key购买 nike

今天我从一个网站的设计师那里得到了一个布局。

背景上是全身的图案。标题图像在右侧 flex 裁剪。

截图如下:

enter image description here

我无法在 CSS 中使用 border-radius 构建那种半径。PNG 蒙版不是一个选项,因为模式必须匹配。

知道某人的特殊技巧,可以在 CSS 中构建那种 border-radius 吗?

最佳答案

包装器、位置、半径和阴影可以做一些非常接近的事情:

有关边界半径的更多信息:

https://www.w3.org/TR/css3-background/#the-border-radius

div {
box-shadow:inset 0 0 10px white, inset 0 0 15px gray;
display:table;/* or inline-block/inline-table */
overflow:hidden;/* clip content */
border-radius:0 20% 20% 0 /80%;/* cut off basic border-radius */
position:relative;/* bring at front so img doesn't fade behind body */
}
img {
display:block;/* gap underneath .. or vertical-align:top/bottom */
position:relative;
z-index:-1;/* let inset shadow of parent lay over it */
}
body {
background:brown
}
<div>
<img src="http://lorempixel.com/300/250"/>
</div>

关于html - 裁剪边界半径非常大的图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35901522/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com