Build all HTML stuff by hand is a pretty hard work.
Coding all this stuff , like buttons, forms, divs and allover html widgets, can be a pleasant work if you find ways to optimize and reduce time of coding.
A simple way to do that is to develop some PHP api that allows to generate all forms and all HTML widgets that you need.
After it is just call the class target and pass to it some parameters like bg colors, alignment, size...
On this article i will not do all the job to you but i will show how html can be embbed , developing a plain code snnipet, where u can study how process is done.