For some reason, my document is displaying improperly, but when I adjust the size in editor, it seems to reformat into the proper format. How can I make the document format this way from the beginning?
Did you write the current code you have? If so, then you should already know how to create add and event listener to check for the DOMContentLoaded event. If not, then you should do some research on how to add an event listener for specific events and how to call a function for the event.