HTML HTML Basics Going Further with HTML Links and Paths Challenge

Jasmine Willis
Jasmine Willis
7,617 Points

how to Set the <img> element's src attribute to a path that goes one level out of the current folder

Set the <img> element's src attribute to a path that goes one level out of the current folder and inside a folder named img.

index.html
<!DOCTYPE html> 
<html>
  <head>
    <title>Portfolio Page</title>
  </head>
  <body>
    <img src="img/logo.png" alt="Site logo">
    <ul>
      <li><a href="">Home</a></li>
      <li><a href="">Portfolio</a></li>                
    </ul>
    <h1 id="portfolio">My Portfolio</h1>
  </body>
</html>

1 Answer

Nils Kriedner
Nils Kriedner
Front End Web Development Techdegree Student 19,060 Points

Hi Jasmine, you go one level out of the current folder by typing two dots followed by a forward slash: ../

So like this for example:

<img src=“../img/logo.png“ alt=“logo“>