id = "contact_details"のセクションをid = "form"の横に表示させようとしています。私のCSSスタイルシートの1つでは動作しますが、別のものでは動作しません。私はどこが間違っているのか分かりません...さまざまな幅で、相対位置なしで、それを試しました。なぜ私の "浮動小数点:左;うまくいかない?
あなたのお手伝いをさせていただきます。あなたが別のスタイルシートファイルにこのコードを配置する場合乾杯、マリー
#wrapper {
width: 989px;
margin: 0 auto 0;
position: relative;
background-color: gray;
}
#contact_details {
float: left;
position: relative;
width: 350px;
padding-top: 30px;
padding-left: 30px;
padding-right: 30px;
background-color: blue;
}
#form {
float: left;
position: relative;
width: 450px;
padding-top: 30px;
padding-right: 30px;
background-color: red;
}
#form_table {
padding-left: 0px;
padding-right: 0px;
}
<body>
<div id="wrapper">
<header></header>
<nav></nav>
<section id="contact_details">
<h1>Contact Details</h1>
<br>
<h3>Physical Address</h3>
<p><em>There and Back Travel</em></p>
<p>Travel House Level 1</p>
<p>Travel Line North</p>
<p>Waikanae</p>
<p>New Zealand</p>
</section>
<aside id="form">
<h1></h1>
<form name="user_details">
<table id="form_table">
<tr>
<td class="form_cell"><label for="first_name">First Name:</label></td>
<td class="form_cell"><input type="text" name="first_name"></td>
</tr>
<tr>
<td class="form_cell"><label for="surname">Surname:</label></td>
<td class="form_cell"><input type="text" name="surname"></td>
</tr>
<tr>
<td>Preferred tour types:</td>
<td>
<input type="checkbox" name="adventure">Adventure<br>
<input type="checkbox" name="beach">Beach<br>
<input type="checkbox" name="leisure">Leisure<br>
</td>
</tr>
</table>
<input type="submit"><input type=reset>
</form>
</aside>
<footer></footer>
</div>
</body>
コードスニペットを実行して、あなたはそれがうまく働いていることがわかりますしてください。 –