我有以下CSS:
.me-header {
display: inline-block;
position: relative;
top: 50px;
left: 10px;
}
.me-header a {
color: #333;
font: 10px "Lucida Grande", Helvetica, sans-serif;
text-decoration: none
}
.resume-header {
display: inline-block;
position: relative;
top: 50px;
left: 100px;
}
.resume-header a {
color: #333;
font: 10px "Lucida Grande", Helvetica, sans-serif;
text-align: center;
text-decoration: none
}
.center-text {
text-align: center;
}
以及以下 HTML:
<div class="me-header">
<a href="#"><img src="media/me-icon.png" alt="Picture of Christian Selig"><br> <span class="center-text">Contact Me</span></a>
</div>
<div class="resume-header">
<a href="resume.pdf"><img src="media/resume-icon.png" alt="Resume icon" title="Click to download resume (PDF)"><br> <span class="center-text">Resume (PDF)</span></a>
</div>
但我的文字仍然左对齐。为什么?