2013-03-13 25 views
0

我有一個跨度範圍內的兩個跨度中心旁邊的otherother,class inside_span up和inside_span向下,它們對齊到pulse_result_format跨度的左側,我已經試過margin:0在脈衝結果格式範圍上自動,不起作用,並顯示:inline-block;爲什麼跨度不在這個div內?

HTML:

<div class="pulse_votes_container thumb1"> 
    <span class="pulse_vote_buttons"> 
    </span> 
    <span class="pulse_result_format"> 
     <span class='inside_span up'>{up}</span> 
     <span class='inside_span down'>{down}</span> 
    </span> 
</div> 

CSS:

.inside_span { 

    display: inline-block; 
    width:40%; 
    border-radius: 3px 3px 3px 3px; 
    margin: 10% auto 0px 0px; 
    float:left; 
} 

.down { 

    background-color:#FF6E25; 
} 

.up { 

    background-color: rgb(70, 136, 71); 
} 

.pulse_result_format { 

    display: inline-block; 
    float: left; 
    width: 100%; 
    text-align: center; 

    font-weight: bold; 
    color: rgb(255, 255, 255); 
    text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.25); 
    white-space: nowrap; 
    vertical-align: baseline; 
} 

.pulse_votes_container { 

    width:100%; 
    height:100%; 
    display: inline-block; 
    text-align: center; 
} 

回答

0

取出float:left.inside_span

.inside_span { 
    display: inline-block; 
    width:40%; 
    border-radius: 3px 3px 3px 3px; 
    margin: 10% auto 0px 0px; 
} 

jsFiddle example

相關問題