Positionnement absolue relatif a un block
Posté : 25 sept. 2007, 18:27
Bonjour,
je ne comprends pas, j'ai un element qui devrait se positionner en bas d'un bloc conteneur, mais cet element (un bouton d'envoi de formulaire) s'obstine a vouloir se placer en bas de ma page...
Voici mon CSS (en integralité):
et le code de la page HTML qui pose probleme :
Merci d'avance,
Netsupra
PS : si vous avez des remarques generales sur mon CSS, je les prend volontier vu que ca fait 3 jours que je fais du CSS :s
je ne comprends pas, j'ai un element qui devrait se positionner en bas d'un bloc conteneur, mais cet element (un bouton d'envoi de formulaire) s'obstine a vouloir se placer en bas de ma page...
Voici mon CSS (en integralité):
Code : Tout sélectionner
#page {
margin: 0;
text-align: justify;
}
a:link, a:visited {
text-decoration: none;
border-bottom: 1px dotted;
color: black;
}
a:hover {
border-bottom: 1px solid;
font-style: italic;
color: black;
}
h1 {
font-size: 2em;
font-family: serif;
font-weight: bold;
color: black;
text-align: center;
margin: 0px;
margin-bottom: 25px;
padding-top: 10px;
padding-bottom: 10px;
border-left: 2px solid black;
border-right: 2px solid black;
border-bottom: 2px dotted black;
border-top: 2px dotted black;
}
hr {
display: none;
color: black;
background-color: black;
height: 1px;
width: 85%;
border: 0;
margin: 0px;
}
#loginbox {
font-family: helvetica;
border: 1px dotted gray;
width: 200px;
padding-top: 3px;
padding-bottom: 0px;
padding-left: 0px;
padding-right: 0px;
margin-left: auto;
margin-right: auto;
margin-top: 25px;
margin-bottom: 10px;
text-align: center;
}
#loginbox input[type=text], [type=password] {
width: 190px;
border: 1px solid gray;
padding: 2px;
margin-bottom: 3px;
}
#loginbox label {
float: left;
margin-left: 5px;
}
#loginbox input[type=submit] {
position: absolute;
float: left;
bottom: 2px;
margin-top: 5px;
border: 1px solid gray;
background-color: white;
font-weight: normal;
width: 8em;
}
#loginbox input[type=submit]:hover {
margin-top: 5px;
margin-bottom: 0px;
border: 1px solid gray;
background-color: white;
font-weight: bold;
width: 8em;
}
#status {
margin-top: 25px;
margin-left: auto;
margin-right: auto;
padding: 5px;
border: 1px solid gray;
background-color: pink;
text-align: center;
font-weight: bold;
height: auto;
width: 50%;
}
#status .remainingtries {
font-weight: normal;
}
#error {
width: 100%;
font-weight: bold;
font-size: 2em;
border: 2px solid red;
font-style: arial;
text-align: center;
padding: 5px;
}
Code : Tout sélectionner
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title>Bienvenue sur l'interface de gestion UFR7 - PPCS</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body>
<div id="page">
<h1>BIENVENUE</h1>
<hr />
<div id="loginbox">
<form action="" method="POST">
<label for="login">Login : </label><br />
<input type="text" name="login" maxlength="12" id="login"/><br />
<label for="password">Mot de passe : </label><br />
<input type="password" name="password" maxlength="12" id="password"/><br />
Rester connecté ? <input type="checkbox" name="keepconnection" /><br />
<input class="submit" type="submit" name="submit" value="Se connecter" />
</form>
</div>
</div>
</body>
</html>
Netsupra
PS : si vous avez des remarques generales sur mon CSS, je les prend volontier vu que ca fait 3 jours que je fais du CSS :s
en haut à gauche de ce sujet.