Super Fantastic Resizable CSS Rounded Corners!
by Mark Nutter of nuttersmark.com
by Mark Nutter of nuttersmark.com
There are many rounded corner box solutions out there, but I found most of them to be lacking in one key area: resizability over a patterned background. In order to adhere to these requirements, all four corners of the box must be independently defined, which leads to relatively large amount of slices.
Using this solution, you can resize your boxes as needed without the need to go back to photoshop for different widths on your corners. If you happen to be a rails developer, I also have a solution for integrating this solution into your app via a very handy helper method. A similar solution should be easy to implement in any other framework as well.
All widths highlighted in yellow are relative to the width highlighted in purple. They are not a proportion, but rather a displacement. For example, if you want your rounded corner box to be 500px wide instead of 700px wide, you must subtract 200px from all highlighted values you see above.
These images comprise the makeup of the rounded corner boxes. This of course assumes you want a drop shadow this dramatic. You can use any styling you want, and as long as your slices are as big or bigger than the ones you see here, you can make them work by nudging them around in the css above.
Here are the PNGs for non-retarded browsers
Here are the GIFs for browsers with special needs
* Note: these images have transparent backgrounds *
Enter a width and watch this box magically resize!
You can drag me around, too!