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 trialRon Carrigan
1,816 Pointstrying to add images in how to make a website - I've tried everything but I'm not grasping what it is I'm supposed to do
trying to add images in how to make a website - I've tried everything but I'm not grasping what it is I'm supposed to do
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Nick Pettit</title>
</head>
<body>
<header>
<a href="index.html">
<h1>Nick Pettit</h1>
<h2>Designer</h2>
</a>
<nav>
<ul>
<li><a href="index.html">Portfolio</a></li>
<li><a href="about.html">About</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</nav>
</header>
<section>
<ul>
<li> numbers-01.jpg </li>
<li> numbers-02.jpg </li>
<li> numbers-06.jpg </li>
</ul>
</section>
<footer>
<p>© 2013 Nick Pettit.</p>
</footer>
</body>
</html>
1 Answer
David Clausen
11,403 PointsWell in html everything you want to do has a TAG and ATTRIBUTES associated with that tag. Example:
<a> This is a tag for a link '<a>' </a>
<a href="www.google.com"> This is a tag for a lank that has an attribute href to point where the link goes </a>
So images also have a tag and attribute
<img> <--- this is a image tag
<img src="image1.jpg"> < ---this is an amage tag with an attribute to designate what image i want to use
Image tags DO not need to be closed like a link tag <a></a>
the src attribute is decribing where the image is too.
Imagine file directory:
Webpage (folder)
-images (folder)
--image1.jpeg
-index.htmk
Here the image1.jpeg is inside images folder. So src would me
<img src="images/image1.jpeg">
hope this helps!