我有一个完整的背景图片,我想在其上添加另一个,像徽标。我添加了徽标,但我无法居中。对CSS的任何建议?
这是现在的CSS:
.Merge(nTotalTasks)
.Subscribe((bool result) =>
{
/* Do something with each result. */
});
答案 0 :(得分:0)
我用以下代码实现了它:
HTML:
<div class="center-main">
<div class="center-in"><img class="centered-logo" src="images/logo.png" style="margin-top:-70px;" /></div>
</div>
CSS:
.center-main {
width:500px;
height: 250px;
display: table;
position: relative;
overflow: hidden;
text-align:center;
margin:0 auto;
}
.center-main .center-in {
position: fixed;
top: 50%;
left: 50%;
display: table-cell;
vertical-align: middle;
}
.center-main .center-in .centered-logo {
max-width:300px;
max-height:150px;
position: relative;
top: -50%;
left:-50%;
}