tags:

views:

451

answers:

4
+3  A: 

you should be able to do this with 9 explicitly sized and floated divs. the corner divs are fixed size and have background-url for the 4 corners and the side divs are repeat-y and top bottom divs have repeat-x

Scott Evernden
+1  A: 

You can use a series of spans and 4 images, one for each corner, to make a resizable rounded corner div. Like this:

div {
    background: white url(topleft.gif) top left no-repeat;
}

div span {
    display: block;
    background: url(topright.gif) top right no-repeat;
}

div span span {
    background: url(bottomright.gif) bottom right no-repeat;
}

div span span span {
    padding: 2em;
    height: 0; /* fixes a padding bug in IE */
    background: url(bottomleft.gif) bottom left no-repeat;
}

div span span > span {
    height: auto; /* sets the height back to auto for all other browsers */
}

And now for the HTML:

<div><span><span><span>Round corners!</span></span></span></div>

For an actual example and code please refer to this page for a working example and source code.

Cris McLaughlin
sadly this doesn't display properly on IE7 .. :(
Scott Evernden
Wow your right, I will edit my post after I find a solution.
Cris McLaughlin
+2  A: 

Well, the easiest answer is: use CSS3:

#roundedCornerDiv {
    -moz-border-radius: 1em;     /* for mozilla-based browsers */
    -webkit-border-radius: 1em;  /* for webkit-based browsers */
    border-radius: 1em;          /* theoretically for *all* browsers
                                    dependant on implementation of CSS3 */
    border: 12px solid #ccc;
}
David Thomas
I'm glad you mentioned these I always forget to use them when designing control panels that I don't want to flood with resources (round corner images ect.)
Cris McLaughlin
And it works in all current browsers.
stesch
not using images as per the (clarified) question
Scott Evernden
Ah, I hadn't seen the requirement for image-based corners which...make life harder for yourself? Umm...'kay, my bad.
David Thomas
+1  A: 

You should look into The Thrashbox approach for this.

ddrace
Yeah..... This I wanted.. thanks a Lot DDrace
Wazdesign
So did that work? Will you accept my answer? Thanks, Waz!
ddrace
@ddrace accepted Answer. If You like my Q. then please Vote Up.:)
Wazdesign