这是我的代码:
html
<html>
<body>
<div id="id">
<div class="one">
<img>
</div>
<div class="two">
<img>
</div>
<div class="one">
<img>
</div>
</div>
</body>
</html>
我只想在 div class="one" 内更改图像边距,这是我的 jquery 代码:
$(document).ready(function() {
$(".one").each(function(){
$("img").css("margin-top", 10 "px");
});
});
此代码最终会更改所有图像边距,...帮助!