コンテンツと同じ幅のリボンを配置しようとしていますが、側面が本体に「こぼれます」。例はこちら。これは私が今まで持っていたHTMLです。リボンの中央部分と 2 つの側面の 3 つの画像があります。中央部分を h1 に配置し、現在は側面を揃えようとしています。
<body>
<div id="container">
<div id="leftside">
</div>
<div id="rightside">
</div>
<div id="content">
<header>
<h1>This is the body of the ribbon</h1>
</header>
</div>
</div>
</body>
CSSでの私のショット。私は実験してきましたが、これは必要なことを行いますが、より良い解決策が100万あると確信しています. ここで多くのルールに違反していると確信しているので、これに対するベストプラクティスが何であるかを知りたいです。
#container {
width: 825px;
min-height: 960px;
margin: 0 auto;
}
#left {
background-image: url(side.jpg);
background-repeat: no-repeat;
width: 59px;
height: 48px;
position: absolute;
margin-top: 20px;
margin-left: -58px;
}
#right {
background-image: url(side.jpg);
background-repeat: no-repeat;
width: 59px;
height: 48px;
position: absolute;
margin-top: 20px;
margin-left: 825px;
}
#content {
width: 825px;
min-height: 700px;
margin: 0 auto;
background: url(other.jpg) repeat;
margin-top: 20px;
margin-bottom: 20px;
top:0;
overflow: auto;
}
h1 {
text-indent: -9999px;
background-image: url(banner.jpg);
background-repeat: repeat-x;
margin-top: 0;
height: 48px;
}