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

General Discussion

Build a Simple Website - Image Problem

When trying to write this line of the code:

img src="img/logo.gif" alt="Smells Like Bakin"/

The image that is supposed to come up shows a broken link. I have checked the source file and the image is still there under the same name and everything. Has this happened to anyone else?

34 Answers

You need to use < for opening the IMG tag, and > at the end for closing it. <img src="img/logo.gif" alt="Smells Like Bakin">

Hey Rosetta, also note that "img/logo.gif" specifies a file named "logo.gif" inside of a folder named "img". Let us know if you are still having trouble.

Thanks for your help!

I actually figured it out on my own. The html file was not saved in the right place but I fixed that pretty easily.

Once again, thanks.

Glad you figured it out :satisfied:

Another problem:

I am having trouble having the grid file work within the html showing on the browser. I made sure to include the line of code that referenced the css file beneath the normalize file:

<link rel="stylesheet" href="css/normalize.css" type="text/css" media="screen">
<link rel="stylesheet" href="css/grid.css" type="text/css" media="screen">

And also add the

<div class="container"> 

tag around the structure of the html and indent what was within one space to the right, as told in the video.

However the browser version doesn't reflect the grid changes. The inputs haven't been centered or confined to 1000px.

Any suggestions?

Your help will be greatly appreciated.

To clarify, have you downloaded the "grid.css" file and put it into your "css" directory?

I believe so, I downloaded the files and have them in a folder which contains that, and img folder and the index.html file.

I have been able to reference the images necessary within the code but the css is having no effect.

So you should have folder that contains "index.html" and two other folders, "css" and "img". The "grid.css" file should be inside the css folder.

Yep, that's what I've got.

<link rel="stylesheet" href="css/grid.css" type="text/css" media="screen"> should work if you've got all your files structured correctly. Can you post what you have in your index.html file?

<link rel="stylesheet" href="css/normalize.css" type="text/css" media="screen">
<link rel="stylesheet" href="css/grid.css" type="text/css" media="screen">
<link rel="stylesheet" href="css/normalize.css" type="text/css" media="screen">
<link rel="stylesheet" href="css/grid.css" type="text/css" media="screen">

That should work given that you have the correct folder structure. I'd recommend downloading the project files, and comparing the file hierarchy and code just to make sure you've got everything correct.

I did this as well and it was correct.

Are you familiar with zipping folders? If you are, I could try and see what the problem is.

@Rosetta - Here's a quick primer on file paths that might help you sort out your issue.

I made a zip file of the folder but, I'm not really sure how to attach anything to these forum posts.

Edit: Removed contact info.

So I opened your code, and it looks like the container class is working okay to me. That means that you've got the correct folder hierarchy, and the correct link tags. I'd try closing your internet browser and reopening the "Index.html" file and see if that works.

Hmm, seems like that worked. It must have been an issue with the browser

Well...

I feel extremely silly. Thank you for all your help! :)

Whew, glad you got it working :+1: Have fun with the rest of the project!

Hi guys,

I have the same problem with the page not being centered. Checked the path over and over but can't discover any faults. The grid.css is below normalize.css and I have the folders in my index.html file in Sublime Text. Also tried to close and reopen my browser but no luck. Could somebody have a look at my file path to see if I missed something?

<link rel="stylesheet" href="css/normalize.css" type="text/css" media="screen"> <link rel="stylesheet" href="css/grid.css" type="text/css" media="screen">

Thanks!

<link rel="stylesheet" href="css/normalize.css" type="text/css" media="screen">
<link rel="stylesheet" href="css/grid.css" type="text/css" media="screen">

I can look at the code if You send it.

edit: Im not a pro, but i already finished that course without any problems.

Thanks for your reply Lukasz. Strangely enough, after applying the already written size.css from the zip file, it sorts itself out. Guess problem solved. Hopefully after writing the size.css myself, I will figure out what the problem was in the first place....

Glad to hear. If You ever figure out what the problem was, share it with us if possible.

Will do!

Alright, I fugured it out more or less. I was under the impression that after Nick typed in the code mentioned previously, everything on his page centered, including the 'copyright' at the bottom. Turns out it didn't. Still think my page is a bit off though but maybe that's just me.

I have another situation with the navigation. 'About' and 'Cupcakes & Prices' etc., are supposed to turn out horizontally aligned. Mine aren't. They stay put somewhere halfway on the page, still vertically. I've been through my html and css again whilst playing the video's but as far as I can tell, all my code is exactly the same.

<ul class="nav">
        <li><a href="#">About</a></li>
        <li><a href="#">Cupcakes &amp; Prices</a></li>
        <li><a href="#">Locations</a></li>
        <li class="last"><a href="#">Contact Us</a></li>
      </ul>

ul.nav {
    margin: 120px 0 0 0;
    list-style: none;
    float: right;
}

ul.nav li {
    float: left;
    margin-right: 40px;
}

ul.nav li a {
    color: #FAF3BC;
}

Would anybody have any idea what I need to correct?

I think You forgot to apply grids in HTML above the "ul".

Try this.

<div class="grid_8 omega">
<ul class="nav">
    <li><a href="#">About</a></li>
    <li><a href="#">Cupcakes &amp; Prices</a></li>
    <li><a href="#">Locations</a></li>
    <li class="last"><a href="#">Contact Us</a></li>
  </ul>
</div>

Ofcourse the grid must equal 12 (or 16 if You have a 16 col grid) so if Your first value is something different than 4 then change the grid_8 accordingly.

Ha! Just forgot the > behind omega". Works like a charm now. It seems like the longer you stare at it, the less you see. Thanks again Lukasz!

Leonie re:

It seems like the longer you stare at it, the less you see.

I had a professor in college that used to say ...

Half of all troubleshooting can be solved by going to lunch.

Sometimes all it takes is fresh eyes.

I'll definitely take that advise for next time ;-)

This may sound silly but always remember to keep your browser maximized at full screen when checking updates. I actually spent a while thinking I did something wrong and I had actually done it right I just couldn't see the improvements.

Small tip but would've helped me.

:)