The article on Nifty Corners catched a lot of interest that we didn’t expect at all. So, a big Thank you goes to the international webdesign community and in particular Roger Johansson from 456bereastreet.com and Nate Stainer from web-graphics.com that originally launched the link through the blogosphere.
First, I’m going to present briefly the many improvements I brought to Nifty Corners.
The first and major improvement is that I’ ve extended browser support (hat tip John Gallant from positioniseverything.net for the font-size: 1px CSS fix!). Now, Nifty Corners are fully supported also in Internet Explorer 5.5, covering a very wide range of modern browsers: the examples that we’ll see in this article have been successfully tested in IE6, IE5.5, Opera 7.6, Firefox 1.0 and Safari 1.1. The support for IE5.0 is partial, only classic nifty corners are displayed well, but I got rid anyway of that not-so-good browser sniffing that was used in the first version.
Talking about support: now Nifty Corners work also on XHTML pages served with mime types of application/xhtml+xml (hat tip Roger Johansson for document.createElementNS hint!). There’s also a more robust error detection for the script, and an improved support for class selector.
Second, it’s now possible choose the corners to round: you can choose to round one to all corners.
The other improvements I did are all based on the use of borders, togheter with the coloured stripes and margins, to get a quite wide variety of effects. While with the first version it was possible to get rounded corners transparent outside, now it’s possible to get them transparent inside. A light form of antialiasing is now possible with Nifty Corners, and you can also get nifty corners with edges. Next, I added a basic vertical padding handling that you could find useful in some case.
The firts three components just don’t need changes, whatever you want to accomplish. They need just to be declared in the head section of any HTML page like this:
<link rel=”stylesheet” type=”text/css” href=”niftyCorners.css”>
<link rel=”stylesheet” type=”text/css” href=”niftyPrint.css” media=”print”>
The function NiftyCheck performs a check for DOM support. If the test has passed, the Rounded function is called, that is now the only one function that you should call to get nifty corners. It accepts five parameters, that are in order:
Let’s see them in depth.