我是HTML和CSS的新手,一直在努力解決一個簡單的問題。我正在設計一個音樂空間:http://theparadisegarage.co/,我試圖定位主文本框,以便文本在相同位置的箱子後面「消失」(即結束)。實際上,文本框根據窗口大小更改位置。我試圖將位置設置爲絕對值,並在底部給它一個固定的(px)保證金,但似乎不起作用。爲了讓你瞭解我想要的文本框的基本位置,我將文本框定位在瀏覽器窗口的頂部(因爲這似乎是出於某種原因)。我已經包含了relavent CSS。我很難過......先謝謝你的幫助!內容定位相對於背景
<html>
<body style="background-color:transparent">
<div id="container" style="background-color:transparent" >
<div id="logo">
</div>
<div id="content" style="float:left" >
</div>
<div id="navbar" style="position:fixed">
</div>
</div>
</body>
</html>
body{
width: 100%;
height: 100%;
margin: 0;
padding: 0;
background-image:url(paradisebackground6.jpg);
background-repeat:no-repeat;
background-attachment: fixed;
}
container {
position:relative;
width:100%;
height:100%;
}
content{
position:relative;
vertical-align:bottom;
margin-top:12.5%;
margin-left:190px;
margin-right:auto;
width:625px;
height:372px;
overflow:auto;
z-index:-40
}
不幸的是,我試圖創造一個前景(箱子)和背景(記錄袖子),但是當我把前景放在文本上方時,它不會讓我再滾動。 – LukeTodd 2012-04-09 17:32:31