gpt4 book ai didi

html - 父 DIV 后面的子图像。如何?

转载 作者:行者123 更新时间:2023-11-28 05:45:43 25 4
gpt4 key购买 nike

我在 div 中有一张图片。我需要那个子图像位于父 div 之后。

<div class="parent">
<img src="https://gsa-cmp-fileupload.s3.amazonaws.com/USA_Government_Branches_Infographic.png" class="child" />
</div>

该图像应该在那个红色 边框后面。怎么做?

.parent {
width: 200px;
height: 200px;
border: 1px solid red;
border-radius: 50%;
}

.parent img.child {
width: 200px;
height: 200px;
}
<div class="parent">
<img src="https://gsa-cmp-fileupload.s3.amazonaws.com/USA_Government_Branches_Infographic.png" class="child" />
</div>

This is what I need.

找了好久,还是不知道怎么弄。请提供一些帮助。

最佳答案

我们是这样做的:

.parent {
width: 200px;
height: 200px;
border: 1px solid red;
border-radius: 50%;
overflow:hidden;
}

关于html - 父 DIV 后面的子图像。如何?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37623857/

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