2015-12-02 96 views
1

我想將我的按鈕放在我的文本右側。不幸的是,它不斷下降到一個新的水平。我該如何解決這個問題?顯示按鈕旁邊的文本按鈕

小提琴:http://jsfiddle.net/vkp4q8cv/

代碼:

* { 
 
    text-align:center 
 
} 
 

 
.eupopup-button_1 { 
 
    font-size: 16px; 
 
    background: #ffffff; 
 
    border-radius: 10px; 
 
    -moz-border-radius: 10px; 
 
    -webkit-border-radius: 10px; 
 
    border: 1px solid #1588cb; 
 
    color: #1588cb; 
 
    font-weight: 400; 
 
    position: relative; 
 
    margin: 25px auto 50px auto; 
 
    -webkit-box-sizing: content-box; 
 
    -moz-box-sizing: content-box; 
 
    -o-box-sizing: content-box; 
 
    box-sizing: content-box; 
 
    transition: color 0.1s linear; 
 
    height: 60px; 
 
    width:120px; 
 
    display:inline-block; 
 
    line-height: 60px; 
 
    -webkit-appearance: none; 
 
    z-index: 190; 
 
    text-align: center; 
 
} 
 

 
.eupopup-closebutton { 
 
    position: absolute; 
 
    font-family: helvetica, arial, verdana, sans-serif; 
 
    top: 0; 
 
    right: 0; 
 
}
<div class="eupopup-container eupopup-container-fixedtop eupopup-color-default"> 
 
    <div class="eupopup-head"> 
 
    This site uses cookies to store information on your computer 
 
    </div> 
 
    <div class="eupopup-body"> 
 
    </div> 
 
    <div class="eupopup-buttons" style="position: relative;"> 
 
    <a href="#" class="eupopup-button eupopup-button_1">Learn more</a> 
 
    <a href="/cookie-policy/" target="_blank" class="eupopup-button eupopup-button_2"></a> 
 
    <div class="clearfix"></div> 
 
    </div> 
 
    <a href="#" class="eupopup-closebutton">x</a> 
 
</div>

+1

你想要的按鈕只是在文本(又名內聯)或固定在右側,靠近關閉按鈕? – Kerstomaat

+0

道歉。內聯,在文本之後將是輝煌的:-) – michaelmcgurk

+1

我認爲你正在使這個結構太複雜,這樣一個簡單的任務,但看看這個http://jsfiddle.net/vkp4q8cv/1/ – Lidaranis

回答

1

只是讓一切都內嵌塊

.eupopup-buttons, .eupopup-head, .eupopup-body { 
    display: inline-block; 
} 

我不知道,如果你使用曾經計劃..-身體,b因爲這需要更多的變化

+0

非常感謝,西蒙 - 完美工作:-) – michaelmcgurk