2017-10-28 77 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?

相关问题