【发布时间】:2021-05-29 08:32:39
【问题描述】:
我想将我的图像居中略高于页面中心,同时将文本置于其正下方。
HTML
<div class="center">
<img src="aboutImages/jay.jpeg" id="art">
<span class="description">caption</span>
</div>
CSS
div.center{
display: inline-block;
text-align: center;
vertical-align: top;
}
div img{
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
max-width: 100%;
max-height: 100%;
height: 320px;
width: 250px;
margin-top: 200px;
}
.description{
display: block;
}
【问题讨论】:
-
帮我一个忙,将您的图片托管在 imgbb.com 上,以便我可以通过代码 sn-p 查看它,谢谢。
标签: css