2013-01-10 127 views
2

我試圖用CSS來製作這些圖標(白色圖標除外)。我遇到的問題是,如果我的圖標的名稱超出了寬度並開始包裝文本開始重疊圖像(因爲它向上移動,如第二個元素所示),我需要的文字是移位向下(如第三個元素所示)。讓文字向下而不是向上?

enter image description here

這裏是我的html:

<div class=circle><label>Manage Queries</label></div> 

這裏是我的CSS:

.circle 
{ 
    float:left; 
    position:relative; 
    border-radius: 50%; 
    width: 128px; 
    height: 128px; 
    background: #C70C11 url('myimage.png') no-repeat center center; 
    } 

    .circle > label 
    { 
    font-family:arial; 
    position: absolute; 
    bottom: -20px; 
    text-align:center; 
    width:inherit; 
    } 

我已經試過vertical-align,但我還沒有發現任何與它的成功。

回答

0

要使vertical-align正常工作,您需要將父標籤設置爲display: table。然後,設置與這些屬性的標籤:

display: table-cell; 
vertical-align: bottom; 
+1

注意高度,這是不是有些老蹩腳的IE版本 –

+0

兼容IE -___-是非常愚蠢的。 – jackcogdill

0

嘗試設置垂直褐藻膠:底部;並顯示:內聯;爲你的標籤?

1

labeltop屬性只是設置的div

.circle > label 
{ 
    top: 128px; 
} 

DEMO

相關問題