Inside Technique : Cool Rules
HTML supports an
In this article, we demonstrate a technique for creating appealing horizontal and vertical rules that can blend between two colors without having to resort to an image. This technique can be used both in client-side and server-side scripts using the same code. You can set the start and end color, the number of steps to take to blend the colors, the width and height, the direction, and whether the rule should be aligned left or right (useful for vertical rules):
To create the rule, we defined a function that generates a table with the dimensions you specify. The colors are blended by setting the background colors of each cell appropriately. The number of cells is determined by the number of steps you specify.
Next we continue with an explanation on how to create horizontal rules using the createHR() function.
© 1997-2000 InsideDHTML.com, LLC. All rights reserved.