【发布时间】:2018-11-20 13:56:48
【问题描述】:
stackoverflow 上有很多关于垂直对齐的内容,但在我的情况下它不起作用。请参阅下面的代码和 CSS,如何使 img 居中...
.file-upload-content {
width: 100%;
height: 100%;
text-align: center;
position: relative;
}
.file-upload-image {
position: relative;
max-height: 100%;
max-width: 100%;
margin: auto;
}
.btn-verwijderen{
position: absolute;
top: 0px;
right: 0px;
}
.nr-foto{
position: absolute;
bottom: 0px;
right: 0px;
}
<div class="foto_vak_25_50 border_dashed foto_upload">
<div class="file-upload-content" id="content_foto2" >
<img class="file-upload-image" src="#" id='image_foto2' />
<img src="/img/prullenbak.png" class="btn-verwijderen">
<img src="/img/nr-2.png" class="nr-foto">
</div>
</div>
【问题讨论】:
-
您要居中哪个图像?里面有3张图片
-
您需要哪种类型的输出??
-
image_foto_2 需要居中,nr-foto 在右下角,另一个在右上角(div)
标签: css