Hi
I’m trying to create a content box with a particular style of border that I need to build using 3 images: the top, the bottom and the middle, which repeats to fit the content.
The problem I’m having is getting the top and the bottom to align with the central section so it looks like a ‘whole’.
This is what I want it to look like:
[URL=“http://i792.photobucket.com/albums/yy204/la_tessitore/border.jpg”]http://i792.photobucket.com/albums/yy204/la_tessitore/border.jpg
This is the relevant HTML:
<div id=“mainContent”>
<div class=“bodytop”><img src=“images/bodytop.jpg” /></div>
<h1>Main Content </h1>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam, justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at, odio. Donec et ipsum et sapien vehicula nonummy. Suspendisse potenti. Fusce varius urna id quam. Sed neque mi, varius eget, tincidunt nec, suscipit id, libero. In eget purus. Vestibulum ut nisl. Donec eu mi sed turpis feugiat feugiat. Integer turpis arcu, pellentesque eget, cursus et, fermentum ut, sapien. Fusce metus mi, eleifend sollicitudin, molestie id, varius et, nibh. Donec nec libero.</p>
<h2>H2 level heading </h2>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam, justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at, odio.</p>
<div class=“bodybottom”><img src=“Images/bodybottom.jpg” /></div>
</div>
And this is the CSS I’ve got so far:
#mainContent {
margin: 30px 5px 0px 245px; /* the left margin on this div element creates the column down the left side of the page - no matter how much content the sidebar1 div contains, the column space will remain. You can remove this margin if you want the #mainContent div’s text to fill the #sidebar1 space when the content in #sidebar1 ends. /
padding: 0 20px; / remember that padding is the space inside the div box and margin is the space outside the div box */
background-image:url(Images/bodyback.jpg);
background-position:center;
background-repeat:repeat-y;
}
.bodytop img {
margin: 0;
position:relative;
}
.bodybottom img {
margin: 0;
float:inherit;
}
Can anybody give me pointers on how to make this happen?
Thanks