2 つの div を含む html ページがあり、サイズを変更する必要がありますが、常に 1 行のままです。どうすればこれを構築できますか?
次の例のhtmlコードがあります。
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="content">
<div id="table">
<table>
<tr>
<td>ONE</td>
<td>TWO</td>
</tr>
</table>
</div>
<div id="sidebar">
<p>This is a sidebar</p>
</div>
</div>
</body>
</html>
スタイルシートは次のようになります。
#content {
width: 100%;
}
#table {
width: 100%;
background-color: red;
display: inline-block;
}
#sidebar {
width: 170px;
background-color: blue;
float: right;
display: inline-block;
}