gpt4 book ai didi

配置文件框的 html 模板

转载 作者:行者123 更新时间:2023-11-28 19:17:12 25 4
gpt4 key购买 nike

我想创建如下图所示的配置文件框

enter image description here

并使用 bootstrap 3 在三列网格布局中使用此元素,但用户图片没有完全响应并像这样剪切:

enter image description here

我的 HTML 和 css 代码片段如下:

.ProfileItem {
box-shadow: 0 0 4px 1px rgba(0, 0, 0, 0.2);
padding: 10px;
position: relative;
}
.ProfileImg {
position: absolute;
right: 10px;
top: 10px;
bottom: 10px;
width: 35%;
display: inline-block;
overflow: hidden;
}
.ProfileDes {
padding: 5px 18px 0px 10px !important;
position: relative;
right: 35%;
left: 0;
top: 0;
bottom: 0;
display: inline-block;
width: 65%;
}
.imageContain {
position: absolute;
top: 0;
right: 0;
background-color: white;
overflow: hidden;
border-radius: 50%;
}

.imageContain img {
width: 100%;
}
.profileTitle {
color: #5a5a5a;
font-weight: bold;
text-decoration: none;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.profileInfo {
color: #5a5a5a;
font-size: 12px;
font-weight: normal;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
<div class="ProfileItem">
<div class="ProfileImg">
<div class="imageContain"><img src="https://placehold.it/200x200" alt=""></div>
</div>
<div class="ProfileDes">
<a class="profileTitle" href="" title="">User Fullname</a>
<div class="profileInfo">Description 1</div>
<div class="profileInfo">Description 2</div>
<div class="profileInfo">Description 3</div>
<div class="profileInfo">Description 4</div>
</div>
</div>

你有什么建议吗?

最佳答案

.imageContain {
position: absolute;
top: 0;
right: 0;
background-color: white;
overflow: hidden;
border-radius: 50%;
width: 40%;
height: auto;
}

You only need to add width and height to class 'imageContain'. You need to change width according to your image dimensions.

关于配置文件框的 html 模板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58059792/

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