How can I do 1 by creating a diagonal line in css and then you can fill the gap with solid color under one side of the specified diagonal line
Simple solution: does not exist.
Complete solution: with lots of CSS, absolute positioning, not caring about IE (using -moz-transform: rotate(45deg) ), you can use stupid things ,
See what some people can do ...
Personnaly, I would go with @a solutions: use a background image.
If you really want to draw, refer to SGV, see this article for an example, using the dojo js framework.
source share