首页 > 解决方案 > 为什么我不能从 cloudinary 调整我的图像大小

问题描述

这是我的图像的 CSS 代码(它保持原始大小从 cloudinary)

.img-container {
position: relative;
width: 150px;
height: 150px;
border-radius: 50%;
margin: 0 auto;
margin-bottom: 1.5rem;
}
#skills-img {
height: 100%;
width: 100%;
display: block;
object-fit: contain;
border-radius: 50%;
position: relative;
}

我的图像 HTML

<div class="img-container">
     <img src="" id="skills-image" alt="Skill">
</div>

关于为什么它不会让我调整云图像大小的任何想法?

TIA康纳

标签: javascripthtmlcss

解决方案


看起来像一个错字:CSS是 for #skills-img,HTML 中的图像 id 是skills-image

.img-container {
position: relative;
width: 150px;
height: 150px;
border-radius: 50%;
margin: 0 auto;
margin-bottom: 1.5rem;
}
#skills-img {
height: 100%;
width: 100%;
display: block;
object-fit: contain;
border-radius: 50%;
position: relative;
}
<div class="img-container">
     <img src="" id="skills-img" alt="Skill">
</div>

我希望你得到你的解决方案。


推荐阅读