2 つの div が並んでいます。一方の内容を左に、他方の内容を右に揃えたい。左は適切に整列しますが、右を整列すると、すぐ下の入力テーブルが台無しになります。(画像参照)
これ
悲しいことに
これ
これはおそらく本当に簡単な質問だと思いますが、以前にやったことがあると誓っていますが、理解できません。
これがhtmlです(関連性があるとは思えないため、途中のいくつかのphpループを削除しましたが、関連性があると思われる場合はお知らせください):
<div class='uppertitle'>
<div class='question'><h4>What does {$business['name']} aim to achieve within the next three months?</h4></div>
<div class='addRow'><input type="button" value="Add Goal" onclick="addRow('threemonths')" /></div>
</div>
<div class='goals_table'>
<table id="threemonths" class= 'milestones' width="350px" border="1">
<tr>
<td class= 'deleteRow'><input type="button" name="Delete" onClick="newDelete(this);"/> </td>
<td><input type="text" name="txt[]" value='{$goal['description']}'/><input type="hidden" name="type[]" value='threemonths'></td>
</tr>
</table>
</div>
CSS は次のとおりです。
.addRow {
float: right;
display: inline;
}
div#goals .question {
float: left;
margin-left: 40px;
display: inline;
}
.goals_table {
display: block;
}
要素のサンプルは、https ://dl.dropboxusercontent.com/u/11993667/Hosting%20Signup%20%7C%20%7C%20Page%2010.html にあります。
前もって感謝します。