【发布时间】:2014-05-29 04:15:02
【问题描述】:
我正在尝试将两个 img 标签放在彼此上,但让它们都居中。
这是我尝试做的地方:http://nathanturnbull.me/scrolldiv/home.html
HTML:
<div id="divs" class="div1">
<div class="textcont">
<img class="imglogo" src="gpk.gif" alt="GPK NET">
<div class="textcont" >
<img class="imgbutton" src="gpk.gif">
</div>
</div>
</div>
CSS:
#divs, #div4 {
height: 100%;
width: 100%;
overflow: hidden;
background-size: cover;
font-family: 'Cousine';
font-size: 80px;
color: #ffffff;
text-align: center;
}
.div1 {
display: table;
}
.textcont {
display: table-cell;
vertical-align: middle;
background-color: transparent;
}
.imgbutton {
height: 42px;
width: 84px;
}
【问题讨论】: