我只是想在左下角显示一个超链接(即div .t2),并且我认为它与主体的尺寸有关,但我无法弄清楚。

我的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;
}

最佳答案

如果要将其固定在视口的左下角,则只需将.t2更改为position:fixed;

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


这是一个演示...

http://jsfiddle.net/h2qFU/

关于html - CSS仍然无法将 super 链接与窗口的左下对齐,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/7694536/

10-09 14:26