- Home / CSS3 Previews / Border-radius: create rounded corners with CSS!
Border-radius: create rounded corners with CSS!
W3C has offered some new options for borders in CSS3, of which one is border-radius. Both Mozila/Firefox and Safari 3 have implemented this function, which allows you to create round corners on box-items. This is an example:
Mozilla/Firefox and Safari 3 users should see a nicely rounded box, with a nicely rounded border.
The code for this example above is actually quite simple:
<div style=" background-color: #ccc; -moz-border-radius: 5px; -webkit-border-radius: 5px; border: 1px solid #000; padding: 10px;" >
These different corners can also each be handled on their own, Mozilla has other names for the feature than the spec says it should have though, as it has f.i. -moz-border-radius-topright as opposed to -webkit-border-top-right-radius:
Mozilla/Firefox and Safari 3 users should see a box with a rounded left upper corner.
Mozilla/Firefox and Safari 3 users should see a box with a rounded right upper corner.
Mozilla/Firefox and Safari 3 users should see a box with a rounded left lower corner.
Mozilla/Firefox and Safari 3 users should see a box with a rounded right lower corner.
These are handled by / should be handled by:
-moz-border-radius-topleft/-webkit-border-top-left-radius-moz-border-radius-topright/-webkit-border-top-right-radius-moz-border-radius-bottomleft/-webkit-border-bottom-left-radius-moz-border-radius-bottomright/-webkit-border-bottom-right-radius
TAG CLOUD
acid3
advanced layout
background
border
Browsers
color
css
CSS3.info
CSS WG
csswg
developer tools
disabled
dom
enabled
feedback
firefox
firefox 3.1
fonts
generated content
grid positioning
hixie
HSLA
HTML5
ie6
ie7
ie8
jina bolton
media player
Opera
Opera Dragonfly
presentations
RGBA
safari
selectors
slides
SVG
text rendering
UI
W3C
wasp
Web Fonts
webkit
windows






