Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

Images not showing up when embedding html

Hi,

I've tried so many ways to get images to show up when embedding the html from a google doc template into gmail. I have tried relative path, alternative path, but can not figure out how to get the images to show. The web page and the images are in the same folder, it's on a local pathway, but even when I change the code that way I can't get the images to change. Can anyone help?

I pasted an example of the code with just an example of the image I'd like to display...

Code:
<html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><style type="text/css">ol{margin:0;padding:0}table td,table th{padding:0}.c2{color:#000000;font-weight:400;text-decoration:none;vertical-align:baseline;font-size:11pt;font-family:"Arial";font-style:normal}.c1{padding-top:0pt;padding-bottom:0pt;line-height:1.15;orphans:2;widows:2;text-align:left}.c0{background-color:#ffffff;max-width:468pt;padding:72pt 72pt 72pt 72pt}.title{padding-top:0pt;color:#000000;font-size:26pt;padding-bottom:3pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}.subtitle{padding-top:0pt;color:#666666;font-size:15pt;padding-bottom:16pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}li{color:#000000;font-size:11pt;font-family:"Arial"}p{margin:0;color:#000000;font-size:11pt;font-family:"Arial"}h1{padding-top:20pt;color:#000000;font-size:20pt;padding-bottom:6pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h2{padding-top:18pt;color:#000000;font-size:16pt;padding-bottom:6pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h3{padding-top:16pt;color:#434343;font-size:14pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h4{padding-top:14pt;color:#666666;font-size:12pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h5{padding-top:12pt;color:#666666;font-size:11pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h6{padding-top:12pt;color:#666666;font-size:11pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;font-style:italic;orphans:2;widows:2;text-align:left}</style></head><body class="c0"><p class="c1"><span style="overflow: hidden; display: inline-block; margin: 0.00px 0.00px; border: 0.00px solid #000000; transform: rotate(0.00rad) translateZ(0px); -webkit-transform: rotate(0.00rad) translateZ(0px); width: 624.00px; height: 808.00px;"><img alt="" src="images/image1.jpg" style="width: 624.00px; height: 808.00px; margin-left: 0.00px; margin-top: 0.00px; transform: rotate(0.00rad) translateZ(0px); -webkit-transform: rotate(0.00rad) translateZ(0px);" title=""></span></p></body></html>

5 Answers

Alita Edmonds
Alita Edmonds
6,068 Points

Hi! Usually to prevent confusion, you might want to take the web page out of the folder. It can be a bit confusing to do it that way. But if that is the way that you have done it, then you shouldn't need to specify the the folder you are in because your page is in the same folder. Also, make sure you are typing the right name into the src value. That could be what is causing it. Hope this helps! Keep working!

Ok, I’ll gife that a try! Thank you.

*give

Alita Edmonds
Alita Edmonds
6,068 Points

You're welcome. Happy coding!

Hey Alita,

Still no success... The file path is "C:/Users/owner/Desktop/Tes51100t/images/image1.jpg" I've tried ><a href= with the file pathway and with the ../ any other suggestions?

Alita Edmonds
Alita Edmonds
6,068 Points

Hmmmmm. I know this way of displaying stuff on your computer. I usually use file:/// so maybe that is what is causing it. Are you using workspaces? If you are, could you do a snapshot? It is a bit hard to read with everything clumped together. 'If not then you might just want to try deleting the <img> tag and trying again. Also, I am pretty sure that the src="" should go before the alt="". Let me know what happens! Hope this helps!