css を使用して HTML フォームを中央(ページの中央) に配置しようとしています。
私はすでに他のメンバーの似たような質問を読みました。しかし、私はこれを理解することはできません
これは HTML フォームです。
<html>
<head>
<link rel="stylesheet" type="text/css" href="styles/form_style.css">
<title>My Form</title>
</head>
<body>
<form action="#">
<label for="name">Your Name:</label>
<input type="text" name="name" id="name" /><br />
<label for="email">Your Email:</label>
<input type="text" name="email" id="email" /><br />
<input type="checkbox" name="subscribe" id="subscribe" />
<label for="subscribe" class="check">Subscribe</label>
</form>
</div>
</body>
</html>
これはCSSです:
<style>
form{
width: 700px ;
margin-left: 0 auto;
}
label {
text-align:right;
width:100px;
}
input {
margin-left: 10px;
}
label.check, label.radio {
text-align:left;
}
</style>
私はかなりの時間を試しました。しかし、それでもフォームを中央に配置できませんでした。ガイダンスはありますか?ありがとう