最佳答案
只需使用位置样式即可。
<style type="text/css">
div {
width: 100%;
height: 200px;
position: relative;
}
#img1 {
position: absolute;
top: 0;
left: 0;
}
#img2 {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
}
#img3 {
position: absolute;
bottom: 0;
right: 0;
}
</style>
<div>
<img id ="img1" src="http://lorempixel.com/200/100/">
<img id ="img2" src="http://lorempixel.com/200/100/">
<img id ="img3" src="http://lorempixel.com/200/100/">
</div>
关于css - 将图像左上、居中和右下对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41374511/