スクロールバーが必要かどうかに応じて、最小幅が 500px または幅 100% のコンテナーを使用できます。相対位置を追加し、オーバーフローを非表示にしてから、その内部に幅500pxの別のコンテナを追加し、左右にautoのマージンを設定します。position absolute; を使用してコンテンツを内部コンテナー内に配置します。この場合、あなたの #banner は正しいでしょう: -50px;
ここであなたのフィドルを変更しました:http://jsfiddle.net/s95uz/14/
<style type="text/css">
#main {
min-width:500px;
margin: 0 auto;
position: relative;
overflow: hidden;
}
#inside{
width:500px;
margin:0 auto;
height:100%;
position:relative;
background: red;
}
#banner {
background: green;
position: absolute;
right: -50px;
width: 150px;
height: 300px;
}
#content {
width: 400px;
height: 500px; /* Simulate content */
background: blue;
}
</style>
<div id="main">
<div id="inside">
<div id="banner">
I want this to not create a horizontal scrollbar, when the window/frame is too narrow.</div>
<div id="content"></div>
</div>
</div>