我无法调整图像的大小css/html。我可以在px中调整大小,但不能以%为单位。我已经尝试了最小高度,最小宽度。这是我的代码,我无法调整它。css html百分比调整图像
body{
margin: 0;
}
#top{
background-color: #53FF40;
width: 100%;
height: 50%;
}
#bottom{
background-color: #FF5757;
width: 100%;
height: 50%;
}
.img-yes{
width: 25%;
height: 25%;
}
<!DOCTYPE html>
<html>
<head>
<title>DoYouLoveDogs</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
<body>
<div id="top">
<div class="img-yes">
<img class="img-yes" src="img/yes.png">
</div>
</div>
<div id="bottom">
</div>
<script src="js/jquery.js"></script>
<script src="js/button.js"></script>
<script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')</script>
</body>
</html>
我不明白这个问题。你可以在JSFiddle.net中重现问题吗? – LinkinTED
你到底想要什么?更改img的大小?你可以拨弄它 –
我看到你给的代码没有问题。它调整完美。 – Anonymous