【发布时间】:2018-11-25 14:11:15
【问题描述】:
我在 HTML、CSS 中有问题。 我在他有 1 个 div 和 2 个图像。 第一个图像是背景,第二个图像是头像图像,我无法将其带到中心。 我尝试使用 margin:0 auto;和显示:块;但不起作用。
HTML页面:https://i.stack.imgur.com/vzi9s.jpg
应该怎么看:https://i.stack.imgur.com/WgX6C.jpg
.avatar {
width: 15%;
position:absolute;
}
.img-home {
width: 100%;
height: 100vh;
}
.content {
float:right;
width:75%;
height: 100rem;
}
HTML:
<div class="content">
<img src="images/avatar.png" class="avatar">
<img src="images/bg.jpeg" class="img-home">
</div>
【问题讨论】:
-
欢迎来到 SO,发布您的代码而不是图片,因为它真的没有帮助。