So a computer reads HTML (also CSS) and JavaScript from top to bottom and left to right, meaning it’s best to write code with that in mind?
not always true
as for css selector some selector has higher precedence over other dispite they come late in code
and browser convert the html and css to dom tree
for left to right some operation has also higher precende and even work right to left
just stick that html for structure the page and css for looking and js for action
hope that help and have a nice day