Jquery 定位html图像与css相同

Jquery 定位html图像与css相同,jquery,html,css,Jquery,Html,Css,有没有可能用HTML做同样的事情,因为我想用而不是background属性 什么可以准确地替换背景尺寸、位置等 .post-img { width: 380px; height: 380px; border-radius: 100%; -webkit-border-radius: 100%; -moz-border-radius: 100%; background: url(../images/dsc_00

有没有可能用HTML做同样的事情,因为我想用
而不是
background
属性

什么可以准确地替换背景尺寸、位置等

   .post-img {
       width: 380px;
       height: 380px;
       border-radius: 100%;
       -webkit-border-radius: 100%;
       -moz-border-radius: 100%;
       background: url(../images/dsc_0016.jpg) no-repeat;
       background-position: center;
       background-size: cover;
    }

请帮忙。

我记得不久前我有一个同样的问题。这就是为什么我给出了一个快速的回答

但是您应该始终提供您首先尝试的代码

只需创建一个具有所需维度的div
img容器
。将您的图像放在该分区内

<div class="img-container">
    <img src="path/to/image">
</div>
像那样的东西应该能完成任务。可能需要一点时间。但这会让你知道怎么做

.img-container {
    height: 380px;
    width: 380px;
}

.img-container img {
    display: block;
    height: auto;
    max-height: auto;
    width: 100%;
 }