I deleted all the files in my root folder except the wp-content folder and then copied the files over from a fresh download of WordPress. Then I updated the wp-config with the database name, username and password but I still get the same problem.
When I access WordPress by entering localhost/ in my browser the first page that appears is the sample opening page (Hello world! post) but when I navigate away from there the format changes.
There are two exceptions that I have found. When I navigate from the sample post to either ‘Customize’ or ‘Header’ in the drop down menu the site will remain normal. Anything else and it reverts to a list of links layout.