2015-04-15 28 views
0

的問題是,我工作這麼快,我忘了補充DOCTYPE聲明,現在我添加它,和我的網站變得一團糟,這就是例子:與CSS高度DOCTYPE問題

<div class="container" style="position:relative;"> 
    <div class="form-group" style="margin-top:20px"> 
     <div class="input-group"> 
      <div class="input-group-addon"><span class="glyphicon glyphicon-search"></span></div> 
      <input type="text" class="form-control" placeholder="Task Filter" id="task_filter"> 
     </div> 
    </div> 
    <hr> 
    <div style="overflow-y:scroll;overflow-x:scroll;width:100%;padding:1%;height:50%;border:solid 1px #cdcdcd" id="task_card_container"> 
    </div> 
</div> 

有很多像這樣的元素,所以我不能只是開始重新構造整個HTML,我需要一種方式讓這段代碼在Quirks模式下顯示,但是需要一個適當的DOCTYPE聲明。

+0

你把doctype放在哪裏? – cssGEEK

+0

[爲html5(或任何文檔類型)添加doctype可能的重複打破我的網站](http://stackoverflow.com/questions/21036087/adding-doctype-for-html5-or-any-doctype-breaks-my-site ) – Stickers

+1

@cssgeek - 在正確的位置,否則它不會改變頁面呈現的方式。 – Quentin

回答

-1

你把doctype放在哪裏?因爲是應該走在頁面的頂部的方式,像這樣:

<!DOCTYPE html> 
<!-- Rest of code here --> 

希望這有助於。如果不是,請回來。

+0

這個問題說沒有Doctype,後來又添加了一個。如果它被添加到錯誤的地方,那麼它將不會改變CSS渲染。 – Quentin

+0

是的,所以我告訴他在頂部添加DOCTYPE減速。但是,如果CSS渲染錯誤,他需要添加其他內容 – ByteD3v

+0

正如我以前的評論所說,Doctype **被添加到頂部。 CSS渲染沒有錯。 CSS渲染是錯誤的。問題是要求如何重新創建(在標準模式下)依賴於越野怪癖更多渲染的效果。 – Quentin