tags:

views:

70

answers:

3

coding to get rounded corners for text box using cascading style sheet(css)

+1  A: 

It's called border-radius.

If you want to be picky, you can go back to the old four divisions, each with a different corner to the box specified in the background.

CSS:

div.box { background: url(top-left.png) top left no-repeat }
div.box div { background: url(top-right.png) top right no-repeat }
div.box div div { background: url(bottom-right.png) bottom right no-repeat }
div.box div div div { background: url(bottom-left.png) bottom left no-repeat }
div.box div div div div { background: none } // So extra divisions don't add another corner

HTML:

<div class="box"><div><div><div>
Some text, blah blah blah
</div></div></div></div>

I actually use this method for my website, and then use the border-radius for unimportant things like input fields and small little boxes here and there.

animuson
Probably worth mentioning that CSS sprites would be much better for this (and perfectly suited).
alex
+1  A: 
input[type='text']
{
-webkit-border-radius:5px;
-moz-border-radius:5px;
border-radius:5px;
}

You can also try this http://www.htmlremix.com/css/curved-corner-border-radius-cross-browser

Sakti
+1  A: 

Generate anything you want: http://css3please.com/

tambourine