On many websites (including Formspring), I’ve seen a nice, rounded body content image.
What I mean is, I’ve seen a page where the content’s background is white, with black text, and at the bottom of the content, there is an image that is a round border. This makes the website look very nice and smooth. Look at the bottom of this page.
How do I do that with CSS?
I’ve tried to have a image at the bottom of a page, but it doesn’t extend with the content. Like, the longer my page is, the farther I have to manually move the image. How do I make it automatically move with the content?
Hi cfpmedia.com.
This has been done with browser specific CSS,
(sth like -moz-border-radius: and -webkit-border-radius: )
this doesn’t work in all browsers (especially not in IE).
You can accomplish a look like that by applying a background image to a main container.
E.g.:
CSS
<code> #main {
width: 950px;
margin 0 auto;
background: transparent url(some_rounded_corner_pic.png) left bottom scroll;
} #main2 {
width: 950px;
margin 0 auto;
background: transparent url(some_rounded_corner_pic.png) left top scroll;
}
</code>
Or depending on the page you are creating, you can define special containers for the rounded corner pics,
as you already did in the bodytop section.
What prevents you from doing the same at the bottom ?
As mentioned above you could just nest an inner element and apply the image at the bottom background-position as shown above.
If you want fully flexible round corners then there are many tutorials about.
In your example you have made the mistake of using absolute positioning for your layout which means you can never find the bottom if you want to cap the bottom image as you have done with the top.
You should change to a floated layout and then you can cap the bottom of the layout by clearing the floats. You should also change those non semantic spans and b elements to semantic elements such as headings and paragraphs. Never use breaks for just making space or paragraph breaks.
Here’s a basic floated setup using your dimensions.