2011-10-08 18 views
0

我只是想讓一個超鏈接(這是div .t2)出現在左下角,我假設它有一些事情要做與身體的尺寸,但我無法弄清楚。CSS仍然無法與窗口左下角對齊超鏈接

我的HTML是:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 
<html> 
<head> 
    <title> Incident Report Page </title> 
    <link rel="stylesheet" href="http://...."> 
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
</head> 

<body> 

<div class="header"> 
    Incident Report Page  
</div> 

<div class="t1"> 
<form action="connect_database.php" method=post > 
<p> 
username <input type="text" name = "un"> <br><br> 
password <input type="password" name = "pw"> <br><br> 
<input type="submit" name = "subby" value = "Enter"> 
</p> 
</form> 
</div> 

<div class="t2"> 
    <p><b><a href="http://....">HTTP exchanges</a></b></p> 
</div> 

</body> 
</html> 

和CSS是:

body { 
    font-family: Century Gothic, Arial; 
    background-color: #836FFF; 
    position: relative; 
    height: 100%; 
    width: 100%; 
} 
.t2 { 
    position: absolute; 
    bottom:0; 
    left:0; 
} 
.header { 
    margin: 0 auto; 
    width: 910px; 
    background-color: #6A5ACD; 
    font-size: 60px; 
    color: #473C8B; 
    text-align: center; 
} 
.t1 { 
    margin: 20px auto 0px auto; 
    padding: 10px; 
    font-size: 16px; 
    font-weight: bold; 
    color: #473C8B; 
    text-align: center; 
    padding-top: 20px; 
} 
+1

因此請解釋確切的問題。它不夠接近邊緣?它在對面角落?或者是什麼? – Sparky

+0

它位於頁面左側的中間 – Sam

+0

請參閱我的回答如下... – Sparky

回答

0

如果你想它固定在視口底部/左側角球,然後簡單地改變.t2position:fixed;

.t2 { 
    position: fixed; 
    bottom:0; 
    left:0; 
} 

這裏是一個演示...

http://jsfiddle.net/h2qFU/