And also to make the code much cleaner, use CSS instead of inline HTML attributes. it will make your html code much shorter and easier to read. and you can generate the CSS on the fly also (separately to the html) if you want.
the hardest line to type correctly is: stty erase ^H