我的問題是,我的文字不會完全居中。我該如何解決?我仍然想在中心上下移動。不能居中文本
<center>
<div class="home-text">
<div class="col-md-6 col-md-offset-3">
<h1 class="home-title bounceInUp animated">NAME</h1>
<h2 class="home-desc bounceInUp animated">HTML, CSS, JavaScript, Python</h2>
</div>
</div>
</center>
.home-text {
position: absolute;
left: 50%;
top: 45%;
color: rgb(255, 255, 255);
}
請看看[這裏](https://developer.mozilla.org/en-US/docs/Web/HTML /元素/中心)關於使用中心元素 – Nora
檢查我的答案在這裏 - http://stackoverflow.com/questions/34912619/css-div-center-multi-line-text-vertically-and-horizontally- with-a-background-ima/34912867#34912867 – devtye
十多年來,'center'元素並不是最佳實踐。你從哪些書/資源開始工作? – 2017-01-02 17:10:19