Hello Dev Community! 👋
This is officially Day 2 of my web development journey (as part of my MERN stack goal). After successfully laying down the foundational skeleton yesterday, today was about refinement and expansion.
🧠Key Learnings From Day 2
1. The Trap of Absolute Image Paths
Yesterday, I added my first image, but I used an Absolute Path (pointing directly to a specific folder on my computer's drive). A fellow developer politely pointed out that while this works for me, it will fail for everyone else once the site is deployed.
I learned about Relative Paths, which define the image’s location relative to the HTML file. It makes the codebase portable.
My Fix Today:
I took control of my asset organization! I moved the image into a dedicated assets folder within my project structure and updated my <img> tag:
html
<img src="D:\My Code Base\Quaid e Azam.jpg" alt="Quaid">
<img src="assets/Quaid e Azam.jpg" alt="Quaid">
Top comments (0)