2017-08-22 120 views
0

底部填充,不DIV

#Text { 
 
    font-size: 60px; 
 
    text-align: center; 
 
    margin: 0 auto; 
 
    background: white; 
 
    width: 750px; 
 
    height: 750px; 
 
    padding-bottom: 2cm; 
 
}
<div id="Text"> 
 
    I am groot! 
 
</div>

工作这就是它看起来像右NOW-

Right now

+0

根据您的代码运行片段,并更新问题的确切位置。我找不到任何... – Dekel

+1

你给它一个明确的高度,所以你不会看到很多的底部填充。你期望发生什么? –

+1

它工作正常。填充是绿色的http://i.imgur.com/KqL0rY6.png –

回答

0

你有一个高空。您可以删除高度,然后运行填充或提供超过750像素,而不是2厘米。

#Text { 
    font-size: 60px; 
    text-align: center; 
    margin: 0 auto; 
    background: white; 
    width: 750px; 
    height: 750px; 
    padding-bottom: 1200px; 
    background-color: red; 
} 

#Text { 
    font-size: 60px; 
    text-align: center; 
    margin: 0 auto; 
    background: white; 
    width: 750px; 
    padding-bottom: 200px; 
    background-color: red; 
} 

UPDATE:

在你这也适用。