我想是這樣的:http://www.freeimagehosting.net/image.php?11b1fcb689.png絕望的形象定位問題
編輯:新增的什麼,我試圖做一個更全面的瞭解。我可以使用絕對定位使其看起來很正確,但是當窗口尺寸太小時,內容會從沒有水平滾動條的頁面滑落。這就是爲什麼我想使用div的相對定位。再次感謝。 http://www.freeimagehosting.net/image.php?75c33eaf6e.png
我只知道如何使用絕對定位的div要做到這一點,但是當窗口太小,不能絕對的div內容將滑落的頁面。本質上,圖像垂直居中並在屏幕左半部分對齊。如果窗口太小,我寧願有一個水平滾動條,而不是丟失圖像的一部分。
任何幫助將不勝感激!
麥克
<!DOCTYPE html>
<html>
<head>
<title>Title</title>
<style>
body {
margin: 0;
}
.footer {
color: #202054;
text-align: left;
font-size: 12px;
text-decoration: none;
margin-left: 20px;
}
a { border: 0px; text-decoration: none; font-family: Verdana, "Lucida Grande", Helvetica, Arial, sans-serif; }
span { text-decoration: none; font-family: Verdana, "Lucida Grande", Helvetica, Arial, sans-serif; }
a.footer:hover {
color: #EE001E;
text-decoration: underline;
}
</style>
</head>
<body>
<img style="position: absolute; right: 50%; top: 50%; margin-top: -128px;" src="Resources/chart.png" width="432" height="256"/>
<div style="position: absolute; left: 50%; top: 50%; margin-top: -200px; width: 368px; height: 400px;">
<!-- text content -->
</div>
<div style="position: absolute; width: 100%; height: 20px; bottom: 20px;">
<a style="text-decoration: none;" href="http://www.company.com" >
<img class="footer" src="Resources/logo.png" alt="company" width="21" height="13"/>
</a>
<a class="footer" href="#">Terms of Use</a>
<a class="footer" href="#">Privacy Policy</a>
<span class="footer" style="color: #7E7E7E;">Copyright © 2009 Company Inc. All rights reserved.</span>
</div>
</body>
</html>
它似乎並不真的需要絕對定位,但如果可能的話也請顯示其他內容和網格線。 – xandy 2009-07-12 07:28:03
這個問題似乎是他以前的問題的延續(在這裏找到:tinyurl.com/swarts1,因爲鏈接格式的TinyUrl'd),它可能有助於瞭解問題的歷史。 – 2009-07-12 10:03:09
是的,這是我老問題的延續。我已經添加了代碼,因此無需查看舊帖子。此外,我還鏈接了一個更明確的佈局圖片。有了這些信息,你知道這個佈局是否可行嗎? – 2009-07-12 19:25:03