I have some idea to do the different colored line
-
Use it as an image (not good since i am going to use it all over my website and it will increase the http request)

-
Define 4 or 5 classes(
widht=50px,height=5px,color=somecolor) in css and use the classes in html. (I may need to use more than 20 span, i dont want to increase the number of DOM elements)
Can anyone tell me some other way to do do that different colored line using css and html?
Thanks
You can achieve it using css3.
apply this css to your div
JSfiddle Demo