Skip to the content...

Welcome to the David Walsh Blog. I'm a MooTools, Dojo, jQuery, CSS, and PHP Web Developer located in Madison, Wisconsin, United States. Please contact me if I can make your experience on my website better.

Rounded Corners in Mozilla Firefox

15 Responses »

One of the cool Firefox-specific browser CSS capabilities is the -moz-border-radius set of properties. The moz-border-radius properties allow you to create rounded-corner elements using only CSS.

The CSS

	.sample {
		-moz-border-radius:10px; /* all corners */
		-moz-border-radius-topleft:15px; /* top left corner */
		-moz-border-radius-topright:50px; /* top right corner */
		-moz-border-radius-bottomleft:15px; /* bottom left corner */
		-moz-border-radius-bottomright:50px; /* bottom right corner */
		-moz-border-radius:10px 15px 15px 10px;  /* shorthand topleft topright bottomright bottomleft */
		border:1px solid #fc0; /* border color, per usual */
	}

Wouldn't it be great if we could get all browsers to support CSS rounded corners?

Discussion

  1. December 17, 2008 @ 9:09 am

    Webkit browsers also have similar capabilities using -webkit-border-radius which are closer to the standard which the W3C are proposing for CSS3.

    Webkit and Moz border radius examples

    W3C CSS3 border radius spec

  2. December 17, 2008 @ 9:17 am

    you can find a crossbrowser CSS round corner here:
    http://www.htmlremix.com/curved-corner-border-radius-cross-browser/

    and a crossbrowser JS here:
    http://dillerdesign.com/experiment/DD_roundies/

  3. December 17, 2008 @ 9:21 am

    This is also available with webkit

  4. December 17, 2008 @ 9:23 am

    @Livingstone: Correct, but the syntax is slightly different. Look forward to that tomorrow. :)

  5. tom
    December 17, 2008 @ 12:45 pm

    And there’s some Konquerer action too I believe. -khtml-border-radius or something like that.

    It’s all good stuff for intranets and such, if you want a slightly more polished look within a “closed system” where you have control over the browser used and so on.

  6. December 17, 2008 @ 1:00 pm

    You might want to mention that it’s a CSS3 property…

  7. December 18, 2008 @ 9:04 am

    This is one of the few browser specific tricks I know, for FF and webkit. I still think that the jQuery corners plug-in is more usable, but I’m really concious of IE users. Probably to much.

  8. December 22, 2008 @ 12:14 pm

    I love rounded corners. I really wish Internet Explorer supported them. There is also the -khtml- prefix.

  9. darvin
    December 27, 2008 @ 5:43 am

    You can make curved corned in any browser using 3line css.
    you can get it here. Using Behavior for ie version. It works fine.
    http://www.htmlremix.com/curved-corner-border-radius-cross-browser/

  10. December 13, 2009 @ 6:54 pm

    I say just use CSS3 properties for the rounded corners and any shadowing, they’re aesthetics anyway and won’t break on IE just end up square. This way no hacks, no reliance on Javascript and a kick in the teeth to Microsoft for not supporting W3C standards.

    “OOh I’m gonna start using Firefox as my current browser makes everything look ugly” :-)

Be Heard!

Share your thoughts with fellow developers of all skill levels! I want to hear from you!

Name*:
Email*:
Website:  
Wrap your code with <code> tags, f00!