If the original image were created in a vector-based program -- in other words, something where the x,y,width,height parameters are known and stored -- you can load the generated HTML+CSS in a known reference browser and enumerate the x,y,width,height of the matching elements in the DOM. If your fitness function is a golf score, then something like:
sum( abs(X_expected - X_actual) *
abs(Width_expected - Width_actual) +
abs(Y_expected - Y_actual) *
abs(Height_expected - Height_actual) )
mapped over all elements ought to do the trick. When you hit 0, it's a perfect reproduction.