I recently launched a simple static portfolio site on GitHub Pages for easy maintenance. The main navigation consists of a 3-line title at the top of every page, providing seamless movement throughout the site. However, I have encountered a small (approximately 10px) shift between the home page and all interior pages.
Upon inspecting the code in DevTools, I noticed that both the home page and interior pages have content set to 600px wide with 25px padding on either side. The horizontal margins are set to auto in order to center the main content block on each page, but there seems to be a slight variation in margins between the home page and the interior pages.
To provide examples:
- Home Page
- Interior Page with Single Image
- Interior Page with Multiple Images
There is clearly a discrepancy in margins when navigating from the home page to any of the provided interior pages.
After troubleshooting, it seems likely that the issue is related to the image tag used on all interior pages, which is not present on the home page. For instance, upon removing the lone image on the /about page, the content margins shift slightly and realign with the home page.
My assumption is that the width or size of the images might be affecting the overall content dimensions and subsequently impacting the margins. Despite adjusting the width of the images, I have yet to find a solution to this issue.