我想水平居中三个图像。
.music {
width: 200px;
height: 200px;
background-image: url('image/music1.png');
margin: 0 auto;
display: inline-block;
cursor: pointer;
}
.music2 {
width: 200px;
height: 200px;
background-image: url('image/music2.png');
margin: 0 auto;
display: inline-block;
cursor: pointer;
}
.music3 {
width: 200px;
height: 200px;
background-image: url('image/music3.png');
margin: 0 auto;
display: inline-block;
cursor: pointer;
}
.main_content {
height: auto;
margin: auto;
width:100%;
background-color:#b0e0e6;
}
和明显的html
<div class="main_content">
<a href="documents.php"><div class="documents"></div></a>
<a href="music"><div class="music"></div></a>
<a href="photos"><div class="photos"></div></a>
</div>
css 将所有内容保持在左侧而不是居中。我究竟做错了什么?