2017-10-28 165 views
-4

http://dark-gaming.eu/不能居中文本(不能找到一種方法如何做到這一點,在這種情況下)

我正在(或試圖使)一個網站,應該類同此: https://dribbble.com/shots/2595241-VOID-Conference/attachments/516900

但與「我的」的東西。

但現在我有一個問題,以文本爲中心。運球網站上的「I D E A S」,我想要前。 「D A R K」文本,但它不會以text-align:center爲中心,只是看看(http://dark-gaming.eu),也許你會理解。

謝謝,求助。

+0

建議,請縮小圖像尺寸需要永遠載入。 –

+0

[如何將元素水平和垂直居中?](https://stackoverflow.com/questions/19461521/how-to-center-an-element-horizo​​ntally-and-vertically) – divy3993

+0

嘿歡迎來到stackoverflow,在這裏你可以尋找類似的問題,如果以前問過,你會得到你想要的。如果你仍然面臨同樣的障礙,你可能會發布你的問題,以及你爲實現你想要的代碼/嘗試。謝謝!快樂編碼。 – divy3993

回答

-1

如果您使用的是'h'標籤,您需要在您的CSS中特定。例如:

h { 
     text-align: center; 
    } //This would center all h tags 

或使用於h標籤一類具體包括:

h.cent { 
     text-align: center; 
    } //This would center h tags with the 'cent' class attributed to them 

    <h class="cent"> 
0

在這裏你可以如何居中 HTML

<div class="container"> 
    <p>centered!</p> 
</div> 

CSS

html, body, .container { 
    height: 100%; 
} 
.container { 
    position: relative; 
    text-align: center; 
} 
.container > p { 
    position: absolute; 
    top: 50%; 
    left: 0; 
    right: 0; 
    margin-top: -9px; 
} 

有很多像表等方法,柔性等,你可以找到所有的細節在這裏How to center an element horizontally and vertically?

相關問題