【发布时间】:2017-03-03 14:56:44
【问题描述】:
所以我需要我的代码让图像保持当前设置的纵横比,无论用户是在较小的屏幕上查看网站还是调整浏览器的大小而不是全屏查看。
这是我目前拥有的一些代码,但我只是不确定在保持当前效果不变的情况下该怎么做(即图像并排并在中心对齐)。
<style>
.first-image {
display:inline-block;
text-align:left;
}
.second-image {
display:inline-block;
text-align:right;
}
<body>
<center>
<div class="first-image">
<a href="index.html"><img src="img/leftbryce.png" onmouseover="this.src='img/whiteleftbryce.png'" onmouseout="this.src='img/leftbryce.png'" width="800 px" height="auto"></a>
</div>
<div class="second-image">
<img src="img/whiterightbryce.png" onmouseover="this.src='img/rightbryce.png'" onmouseout="this.src='img/whiterightbryce.png'" width="800 px" height="auto">
</div>
</center>
【问题讨论】: