2012-08-08 191 views
0

我需要樣式表幫助。我有一個div有:需要CSS幫助

Header text with underline, 
icon 
link but 

噸與描述文本。

所有是單獨的控件。

附圖中的'1'是我目前得到的UI,'2'是我想要的。

第二個模塊動態生成並覆蓋第一個div的文本。哪個屬性可以用來解決這個問題?

回答

3

您需要將clear:both添加到標題爲<div>的CSS中。

1

我建議使用尼古拉斯·加拉格爾的clearfix黑客的跨瀏覽器支持回IE6:

http://nicolasgallagher.com/micro-clearfix-hack/

下面的代碼:

.cf:before, 
.cf:after { 
    content: " "; /* 1 */ 
    display: table; /* 2 */ 
} 

.cf:after { 
    clear: both; 
} 

/** 
    * For IE 6/7 only 
    * Include this rule to trigger hasLayout and contain floats. 
*/ 
.cf { 
    *zoom: 1; 
} 

應用cf類的第一div