fix DOM patterns in html and add global classes to css