gpt4 book ai didi

html - 如何将此图像与文本居中对齐?

转载 作者:行者123 更新时间:2023-11-28 16:35:27 24 4
gpt4 key购买 nike

我试图将圆形图像与文本居中,但我无法成功。

我应该如何更改我的代码才能做到这一点?

https://jsfiddle.net/zxwz5739/

<div class="col-sm-6">
<div class="team-1-member">
<div class="round">
<center>
<img alt="Team Member" src="http://i.imgur.com/qIKR0Qt.gif">
</center>
</div>
<h2>John Doe</h2>

</div>
</div>

.team-1-member {
text-align: center;
margin-top: 48px;
}
.round {
border-radius: 50%;
overflow: hidden;
width: 150px;
height: 150px;
margin-bottom: 10px;
}
.round img {
display: block;
min-width: 100%;
min-height: 100%;
}
.team-1 h2 {
margin-bottom: 8px;
}

最佳答案

在 .round 中添加:display: inline-block;

关于html - 如何将此图像与文本居中对齐?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29569755/

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