2017-01-16 35 views
-1

我使用Bootstrap 3與粘腳功能,我注意到,如果我減少到最低窗口,我得到的權利按鈕往前走。不能讓頁腳響應

我想要的是雖然是爲了頁腳高度放大,所以內容不會出去頁腳。

這是我的代碼:

<div id="footer" class="footer"> 
    <div class="pull-left"> 
     <h6 class="text-white">Developed by a normal user as you</h6> 
    </div> 

    <div class="pull-right"> 
     <button type="button" id="select-language" class="btn btn-sm btn-success" rel="select-language" data-original-title="" title=""> 
      Select a language</button> 
    </div> 
</div> 

,這是我的CSS:

.footer 
{ 
    font-size: 13px; 
    width: 100%; 
    height: 50px; 
    background-color: #4790ca; 
    bottom: 0; 
    position: absolute; 
    padding: 5px 10px; 
    display: inline-block; 
    float: left; 
    line-height: 3; 
    text-align: left; 
    font-weight: bold; 
} 

出現的結果是這樣的:

enter image description here

this is a jsfiddle that replicate the issue.

+0

你有什麼要發生時,頁腳變得太小的按鈕上與文本相同的行? – BSMP

+0

您的預期產出是什麼? – Roljhon

+0

'我得到的按鈕正確的前進,這是我的代碼' - 在你的小提琴中,當在Chrome中運行時,當使窗口的寬度變小時,按鈕會在不超過它的文本之下。這不是你想要的嗎?你想要發生什麼? – Nope

回答

-1

出門既然你float荷蘭國際集團在.footerpull-leftpull-right)的所有元素,你需要apply a clearfix就可以了。您可以使用的Bootstrap provides a built-in class

<div id="footer" class="footer clearfix"> ... </div> 

Working example.

Output

+0

是的,這似乎對我工作正常。謝謝。 – AgainMe

+1

其實際上沒有聲明'height'使頁腳響應:)而不是clearfix?只是我覺得嘿嘿 – Roljhon

+1

@AgainMe不要判斷它的封面夥伴的書,沒有做任何事情,爲什麼我應該downvote?我不是故意的,只是說明我發現的:)放鬆! – Roljhon

1

設置你的頁腳auto的高度,如果你想你的按鈕不從頁腳

-1

在媒體查詢您需要設置

.footer { height: auto; text-align: center; }