私はこの問題を約半日解決しようとしています。私はちょうどWebデザインを始めています。私はフォームを水平方向と垂直方向に集中させる必要があります。今は左上にあります。私はすぐにそれを整理しようとしている悪いコードを気にしないでください。水平方向の中心のためのフォームを水平方向と垂直方向にセンタリングする
form {
\t
display: table-cell;
text-align: center;
vertical-align: middle;
}
.trans {
background:rgba(1,1,1,0.6);
}
body {
background-image: url(wallpaper.jpg);
}
.text {
}
.box {
display: table;
width: 100%;
}
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="icon" type="image/ico" sizes"32x32" href="pths_logo32x.png">
<title>Peq Anon</title>
</head>
<body>
<div class="container">
<form>
<input class="trans text" type="text" name="Password">
<button type="submit" onclick="#">Submit</button>
</form>
</div>
</body>
</html>
は '表示を削除:テーブル-cell' –
私はそれをしなかったが、それは水平方向にのみ、それを中心に。 –