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
Rosetta Lediard
1,407 PointsBuild 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
Lisbeth Olesen
1,145 PointsYou need to use < for opening the IMG tag, and > at the end for closing it. <img src="img/logo.gif" alt="Smells Like Bakin">
samiff
31,206 PointsHey 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.
Rosetta Lediard
1,407 PointsThanks 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.
samiff
31,206 PointsGlad you figured it out
Rosetta Lediard
1,407 PointsAnother 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.
samiff
31,206 PointsTo clarify, have you downloaded the "grid.css" file and put it into your "css" directory?
Rosetta Lediard
1,407 PointsI believe so, I downloaded the files and have them in a folder which contains that, and img folder and the index.html file.
Rosetta Lediard
1,407 PointsI have been able to reference the images necessary within the code but the css is having no effect.
samiff
31,206 PointsSo 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.
Rosetta Lediard
1,407 PointsYep, that's what I've got.
samiff
31,206 Points<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?
Rosetta Lediard
1,407 Points<link rel="stylesheet" href="css/normalize.css" type="text/css" media="screen">
<link rel="stylesheet" href="css/grid.css" type="text/css" media="screen">
Rosetta Lediard
1,407 Points<link rel="stylesheet" href="css/normalize.css" type="text/css" media="screen">
<link rel="stylesheet" href="css/grid.css" type="text/css" media="screen">
samiff
31,206 PointsThat 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.
Rosetta Lediard
1,407 PointsI did this as well and it was correct.
samiff
31,206 PointsAre you familiar with zipping folders? If you are, I could try and see what the problem is.
James Barnett
39,199 Points@Rosetta - Here's a quick primer on file paths that might help you sort out your issue.
Rosetta Lediard
1,407 PointsI made a zip file of the folder but, I'm not really sure how to attach anything to these forum posts.
samiff
31,206 PointsEdit: Removed contact info.
samiff
31,206 PointsSo 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.
Rosetta Lediard
1,407 PointsHmm, seems like that worked. It must have been an issue with the browser
Well...
I feel extremely silly. Thank you for all your help! :)
samiff
31,206 PointsWhew, glad you got it working Have fun with the rest of the project!
Leonie Koomen
2,560 PointsHi 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!
Leonie Koomen
2,560 Points<link rel="stylesheet" href="css/normalize.css" type="text/css" media="screen">
<link rel="stylesheet" href="css/grid.css" type="text/css" media="screen">
Luke Buśk
21,598 PointsI can look at the code if You send it.
edit: Im not a pro, but i already finished that course without any problems.
Leonie Koomen
2,560 PointsThanks 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....
Luke Buśk
21,598 PointsGlad to hear. If You ever figure out what the problem was, share it with us if possible.
Leonie Koomen
2,560 PointsWill do!
Leonie Koomen
2,560 PointsAlright, 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 & 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?
Luke Buśk
21,598 PointsI 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 & 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.
Leonie Koomen
2,560 PointsHa! 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!
James Barnett
39,199 PointsLeonie 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.
Leonie Koomen
2,560 PointsI'll definitely take that advise for next time ;-)
Rosetta Lediard
1,407 PointsThis 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.
:)