Agunechemba

Using Google Drive to host images for your website is smart, but the usual public link won’t work as an image source.

No worries — here’s a simple fix:

  1. Copy this code snippet where you want the image in your HTML:
<img src="https://drive.google.com/uc?export=view&id=
  1. Go to your Google Drive image, and make sure it’s set to “Anyone with the link can view.”

  2. From the shareable link, copy the file ID part — the long string between /d/ and /view. For example, in this link:

https://drive.google.com/file/d/1GjcKp6QmaYj3b3846tryJVfFwljiUk9Q/view?usp=sharing

The ID is: 1GjcKp6QmaYj3b3846tryJVfFwljiUk9Q

  1. Paste that ID right after id= in the snippet. It should look like this:
<img src="https://drive.google.com/uc?export=view&id=1GjcKp6QmaYj3b3846tryJVfFwljiUk9Q">

Make sure the entire link is inside double quotes.

Done right? Your Google Drive image should now show up perfectly on your site.

Feel free to share this quick tip!


<
Previous Post
JavaScript Objects Simplified: A Summary of MDN Web Docs
>
Next Post
From Basics to Brilliance: Why Learning Vanilla JavaScript Matters