Rounded corners in CSS3 The usual way of showing rounded corners of rectangle / square in web pages is to slice and export these corner images from fireworks / photoshop. This tutorial deals with how to create rounded corners using styles / CSS. Which exactly means that we will not be using any images for the same. :)
Syntax
.rounded-corners { border: 1px solid #666666; -webkit-border-radius: 9px; -khtml-border-radius: 9px; -moz-border-radius: 9px; border-radius: 9px; } |
Syntax explanation:
This style assigns 2 attributes:
- Width / color / stroke for the border.
- Border radius, which is proportional to the extent of rounded corners we want.
Higher value of 'border-radius' will increase the roundedness of corners.
In the above code, we have covered border radius syntax for Webkit, Konqueror and Mozilla browsers.
The output of the above code is shown below
Limitations:
The above rounded corner style is not supported by IE browsers.
Tags: Style / CSS3 to create rounded corners, rounded corners