CSS > inline.

This script can be much simplier. The css could be inline, so everything is more compact.