Blog

Cool style trick: give your boxes rounded edges without using images
Posted by Lawrence Krubner in Design & Production on 01.26.07

My co-worker Christine points me to this very cool Javascript trick, which allows you to give the DIVs on your page rounded edges, without having to use images. All you have to do is include the Javascript file on the page, and then any time you want a div on that page to have a rounded edge, you just give it a class of “rounded”:

<div class=”rounded”>
This div has rounded edges
</div>

You must also call the “Rounded” function at the bottom of the page, or use the Simon Willison method, which I would prefer. You can even control the degree of roundness by changing the numbers when you call Rounded():

Rounded(’rounded’, 6, 6);



Leave a Reply