<div class="wrapper">
<div class="layer1"></div>
<div class="layer2"></div>
<span>hello</span>
</div>
.wrapper{
width:100px;
height:100px;
background-color:yellow;
line-height:100px;
position:relative;
text-align:center
}
.layer1{
background-color:red;
width:20px;
height:20px;
position:absolute;
top:50%;
left:50%;
}
.layer2{
width:20px;
height:20px;
background-color:green;
margin:0 auto
}
span{
margin-left:30px;
margin-top:10px;
}