위의 다른 훌륭한 대답은 위치 지정을 사용하는 반면,이 것은 수레를 사용합니다. 당신이 선택한 것은 당신에게 달린 것입니다. 각각에는 그것의 공로 및 결점이있다.
CSS
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend, button,
table, caption, tbody, tfoot, thead, tr, th, td { margin: 0; padding: 0; border: 0; outline: 0; vertical-align: baseline; font-weight: inherit; font-style: inherit; font-size: 100%; font-family: inherit; }
body { font: normal 100%/1.5em "Helvetica Neue", Helvectica, Arial, sans-serif; color: #353E34; background: #FFF; text-align: left; }
html>body { font-size: 16px; }
.content-wrapper { width: 100%; float: left; }
.content { margin-right: 220px; background: #9CC; }
.sidebar { float: right; width: 200px; margin-left: -200px; background: #FDE95E; }
.inner { margin: 10px; }
.footer { clear: left; width: 100%; background: black; color: #FFF; text-align: center; padding: 4px 0; }
HTML
<div class="content-wrapper">
<div class="content">
<div class="inner">
<p>Content</p>
</div>
</div>
</div>
<div class="sidebar">
<div class="inner">
<p>Sidebar</p>
</div>
</div>
<div class="footer">
<p>Footer</p>
</div>
용액한다는 보장해야하고 B가 동일 높이가되어 있는가? 아니면 이미 같은 높이입니까? 또는 그것은 중요하지 않습니까? – thirtydot
@thirtydot - 동등하고 고정 된 높이 (업데이트 된 질문) – UpTheCreek
고전적인 "간단한 해결책"이 이미 게시되었습니다. 하나의 div는 float : right, 다른 하나는 margin-right가 오른쪽 div의 너비와 같습니다. – thirtydot