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 How to Make a Website Adding Pages to a Website Style New Pages

matthewroller
matthewroller
2,159 Points

How do I get my image to show up?

Hello, i've just inserted a new image and have it uploaded in my img folder. I used this code to insert it and it isn't showing up..

<img src="img/mbr.jpg" alt="Photograph of Matt" class="profile-photo">

It's not bringing it up in my preview , any ideas?

5 Answers

Gary Insley
Gary Insley
14,133 Points

What code did you use to display the image?

Are you looking to display the image as a background image or as a standalone image?

matthewroller
matthewroller
2,159 Points

Hi Gary, the above post is not letting me post the code I used to insert an image in the HTML. The weird part is that it is displaying the alt="Photo of me" part of the code in the preview. The actual image is missing though?

GURJAP SINGH
GURJAP SINGH
7,556 Points

hi! @matthewroller I am not sure if you are trying to setup the profile picture on your About page. if you can see the image on the page and its not aligned use the css code below:

/*****************************  
  Page About
********************************/
.profile-photo {
 max-width:150px;
  margin:0 auto 30px;
  border-radius:100%;


}

or if you setup the image you can create a new section as given below:

<section>
     <img src="img/photo.jpg" alt="photograph" class="profile-photo">
<h3> text</h3>
<p>
</p>
</section>
matthewroller
matthewroller
2,159 Points

Hello GURJAP, it's saying my picture has been uploaded and my coding is correct. However in the file path to images, it appears the mbr.jpg picture is removing itself from the server, or never being uploaded at all..

I signed in today and it was missing ..

GURJAP SINGH
GURJAP SINGH
7,556 Points

I had the same issue initially, I just remebered. So what i Did was I uploaded the file and named it as nick.jpg (same as the instructor had his own picutre.) and it worked. I know it sounds weird. Looks like there may be a bug in the workspace. if you really want to test your code (your picture), you can download the workspace by clicking on "File" and "Download Workspace" and use your own editior such as sublime or notepad++ to open them. You will have the same result (Preview). Let me know if that worked. You really don't need to stay on the workspace, TeamTreeHouse provides. Thanks