I agree that whenever I've to "adjust" something in HTML, CSS, its always a struggle with multiple tries and write-run-write-run cycle.
But again, this has nothing to do with how you design and write code in a static language.
Sure it does, for example in SSR frameworks, you want the HTML template engine or UI designer to see those components.