HTML is for hypertext documents, and CSS an organ of the same organism called 'HTML/CSS'. It's made for text documents, and applying it to the implementation of GUI-centric applications has always been an ugly hack. For awhile (90s to 00s AJAX) it was necessary, and now the whole professional ecosystem has built up tremendous inertia over the millions of accumulated people/hours of perfecting this 'competency'/hack. Now though, I would recommend to switch over to building 2D webapps entirely out of SVGs (say with React + Flux) e.g.:
https://github.com/Terebinth/Vickers
or, even better, to building them entirely out of WebGL. SVGs are easy and would lead to a wonderfully efficient workflow, but I think WebGL holds the advantage for performance considerations, given the way it goes to the hardware.