Chapter 15.3.1. Rounded Corners

We start with the most humble feature in the package: rounded corners. Generally, if you want a rounded-off look for your application, you need to resort to images that you slice up just right to achieve the effect. The Visual module lets you round the corners of an element (or collection of them) with a single call, no images required.

You can see the rounded-corners effect for yourself using MochiKit’s interactive interpreter:

writeln(DIV({"class" : "rounded", "style" :
    "text-align:center; background:black; color: white"},
    "Square edge or round, you decide!"));

That command gives us a white-on-black <DIV> element, with the traditional squared-off corners. Now run this:

roundClass("div", "rounded");

Our <DIV> ...

Get Rapid Web Applications with TurboGears: Using Python to Create Ajax-Powered Sites now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.