In light of the future resume assignment I wanted to review some best practices for the nesting order of HTML elements. Keeping track of where tags begin and end can be challenging, but having a clearer understanding of nesting helps.
The definition of nesting is when one element is placed inside of another element. Nesting allows you to apply multiple HTML tags to a single piece of content. Whenever we nest one tag inside of another, we indent the inner tag so that the overall tag hierarchy is clear.
Another overall purpose this serves is to make sure the parent-child relationship between elements is distinguishable. Proper nesting will make your code easier for others to read and for you to maintain.
I want to say that the golden rule of coding you should follow is: treat others as you would like to be treated and leave it better than you found it. This is also just useful advice for life in general.
And if there’s one thing I have learned during the course this week it is that it’s better to indent and nest your code as you’re doing it, than it is to fix later.