treehouse : what would you like to learn today?
Web Design Web Development iOS Development

rounded corners?

  • hey guys,

    theres a lot of css rounded corner methods out there, but which do you prefer? i'm looking for simplicity
    what are pros/cons of the ones you use?
  • I have three techniques I pick from when I need to employ rounded corners:

    1) Totally fake it.
    2) Put relative positioning on the element, and put four absolutely positioned div's inside of it each set to each of the corners that have their respective rounded corner in it.
    3) Use a jQuery plugin (there are several available, just Google around)

    You can use use jQuery for #2 as well, if you want a more home-grown solution. I talk about doing that in this article a bit.
  • Here is a nice collection with techniques how you can do it: http://cssgallery.info/rounded-cornes-css/

    Personally I really like the cropping corners technique
  • CSS 3.0 has now given us the border-radius property - it looks rubbish though lol. But a sign of good things to come? :D