我得到了一個小問題,我測試似乎沒有任何工作。HTML-CSS與div的位置問題
我的HTML:
<div id="parent">
<div id="top_parent">Top_background
<div id="top">Top_Picture</div></div>
<div id="content">Here comes random stuff<div>
</div>
<div id="bottom">Footer</div>
CSS:
#top_parent {
background:#f00;
height:100px;
}
#top{
background:#0f0;
float:right;
position:relative;
height:100px;
width:50%;
}
#content{
top:-50px;
background:#00f;
<!-- position:relative;-->
height:100px;
width:80%;
margin:auto;
}
#parent{
background:#000;
height:350px;
width:100%;
}
#bottom {
height: 50px;
background:#ff0;
bottom:0px;
<!--position:absolute; -->
<!--position:relative; -->
}
現在我的問題是,頁腳不會在parent
DIV下得到的,它停留在內容區域。我究竟做錯了什麼?
JSF鏈接:my source
感謝您的幫助。
注意,CSS中的註釋是用'/ *'和'* /'劃定的,而不是'<! - '和' - >'。通常CSS解析器會簡單地忽略其中有錯誤的行,但是比抱歉,imo更安全。 – 2010-08-06 13:37:07
啊對,我的最後一個網站是在2年前左右,所以我簡單地忘了:D – domiSchenk 2010-08-06 22:51:44