2014-01-15 58 views
0

我正在製作一個簡單的web應用程序。今天,我決定引入bootstrap,以使用一些UI元素。無論如何,包括引導都破壞我自己開發的任何CSS。即使!important也無法解決問題。Bootstrap破壞ul和li元素

引導css文件包含之前:

Before including CSS file of Bootstrap

後:

After including CSS file of Bootstrap

有什麼不對?我該怎麼辦?

編輯:

後,具備列表組和列表組項類,我得到:

enter image description here

所以,最後,我怎麼有文字進來與複選框相同的行嗎?

+2

請出示相關'HTML'和'CSS'爲更好的解決方案。 – Anup

+0

bootstrap css覆蓋了你的css ...你可以使用'inspect-tool'來驗證它,然後以更合適的方式分配類,以避免重複! :) – NoobEditor

+0

@coder顯示你的代碼或使一個http://fiddle.net –

回答

1

嘗試INCO-操作你的CSS成引導所採用的類名。

4

這是你應該如何在引導使用list: -

DEMO

<ul class="list-group"> 
    <li class="list-group-item"><input type="checkbox"> Hi</li> 
    <li class="list-group-item"><input type="checkbox"> How</li> 
    <li class="list-group-item"><input type="checkbox"> Are</li> 
    <li class="list-group-item"><input type="checkbox"> You</li> 
</ul> 

您需要申請自舉類自舉實現新的佈局。

http://getbootstrap.com/components/#list-group

+0

請看編輯的問題。 – coder

+0

查看已編輯答案中的演示。 – Anup

1

這句法將確保您的複選框的標籤也可點擊:

<ul class="list-group"> 
    <li class="list-group-item"> 
     <div class="checkbox"> 
      <label><input type="checkbox" checked>Check me!</label> 
     </div> 
    </li> 
    <li class="list-group-item"> 
     <div class="checkbox"> 
      <label><input type="checkbox" checked>Check me too!</label> 
     </div> 
    </li> 
</ul>