我試圖實現沿着1000px固定寬度頁面的左側和右側的虛線(自定義)無聊。元素相對位置在右邊:元素的0
左邊的一個是好的,這部作品一種享受:
#border-left{
position: absolute;
float:left;
top: 0px;
bottom: 0;
width: 5px;
background-image: url('../img/border.gif');
background-repeat:repeat-y;
}
但是當我做了右手邊,它不會完全奏效。我需要它相對於1000px而不是窗口的位置。
#border-right{
position: relative;
right: 0;
top: 0;
bottom: 0;
margin-top: -90px;
width: 5px;
background-image: url('../img/border.gif');
background-repeat:repeat-y;
}
父元素:
#container{
width:1000px;
display: block;
margin:0px auto;
text-align:left;
padding-top:90px;
}
這是行不通的。我可以做到這一點嗎?我需要它基本上浮動:正確(但我不能讓高度100%的瀏覽器窗口)。謝謝
你不能漂浮東西,絕對把它放在你的邊界左邊的例子中。 –