MathCurvesSurfacesWallpaper GroupsGallerySoftwarePOV-Ray
ProgramingLinuxPerl PythonHTMLCSSJavaScriptPHPJavaEmacsUnicode ♥
Web Hosting by 1&1

CSS: Round Corners Examples: border-radius

Xah Lee,

This page shows a example of using CSS3 to make round corners. You can do that with the “border-radius” attribute.

Here's a “div” element with round coners:

l👀k! Round corners!

Here's the CSS code:

div {
width:100px; height:100px;
border:solid thin black;
border-radius:10px;
}

Examples

Each of the following have width:100px; height:100px.

border-radius:
0px
border-radius:
10px
border-radius:
20px
border-radius:
30px
border-radius:
40px
border-radius:
50px
border-radius:
60px
border-radius:
70px
border-radius:
80px
border-radius:
90px

Once the “border-radius” is more than half of the width or height (whichever is smaller), the whole thing becomes a circle.

Rectangle Examples

border-radius: 50px
<div style="width:200px; height:100px; border:solid thin black;border-radius:50px;">border-radius: 50px</div>

Browser Support

“border-radius” is supported in all browsers, as of .

Reference

http://www.w3.org/TR/css3-background/

blog comments powered by Disqus