Build a Travel Agency Page - Build a Travel Agency Page

Tell us what’s happening:

Hey everyone I’m being told “Each figure element should contain a figcaption element as its second nested element.” however I can’t quite see the issue with what I have coded

Your code so far

<!DOCTYPE html>
  <html lang="en">
    <head>
      <meta charset="utf-8">
      <meta name="description"
      content="Discover amazing travel deals for the best prices"/>
      <title> Travel Agency Page </title>
      </head>
      <body>
      <h1>Egypt</h2>
      <p>Join us for a jetsetting adventure to the oldest settlements of humanity, from the pyramids to your luxury 5* resort, you'll be living it up like the Pharaohs!</p>
      <h2>Packages</h2>
      <p>Just for you we have 2 avalible packackes today</p>
      <ul>
        <li><a href="https://www.freecodecamp.org/learn"target="_blank">Group Travels</a></li>
        <li><a href="https://www.freecodecamp.org/learn"target="_blank">Private Tours</a></li>
        </ul>
      <h2>Top Itineraries</h2>
      <figure>
       <a href="https://www.freecodecamp.org/learn"target=_blank>
        <img src="https://cdn.freecodecamp.org/curriculum/labs/colosseo.jpg">
        <figcaption>This is not in egypt</figcaption>
        </figure>
        
      <figure>
        <a href="https://www.freecodecamp.org/learn"target=_blank>
        <img src="https://cdn.freecodecamp.org/curriculum/labs/alps.jpg">
         <figcaption>Also not egypt</figcaption>
       </figure>

      <figure>
        <a href="https://www.freecodecamp.org/learn"target=_blank>
        <img src="https://cdn.freecodecamp.org/curriculum/labs/sea.jpg">
        <figcaption>Also not egypt</figcaption>
        </figure>
        </body>
        </html>



   

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36

Challenge Information:

Build a Travel Agency Page - Build a Travel Agency Page

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/lab-travel-agency-page/669e2f60e83c011754f711f9.md at main · freeCodeCamp/freeCodeCamp · GitHub

Welcome to the forum @Georgerspace,

Remember that all HTML elements, except void elements, require an opening tag and a closing tag to be complete. Is your a element inside the figure element complete?

Happy coding

Hey @Georgerspace,

The issue comes down to how your HTML elements are nested inside your <figure> tags.

Currently, your <img> and <figcaption> elements are placed inside the anchor tag (<a>), like this:

HTML

<figure>
  <a href="...">
    <img src="...">
    <figcaption>...</figcaption>
  </a>
</figure>

Because of this, the direct children (first-level elements) of your <figure> tag is just the <a> element, rather than having the <figcaption> nested directly under <figure> as its second child.

How to Fix It:

You need to move the <figcaption> outside of the <a> tag so it sits directly inside <figure> right after the link:

HTML

code removed by moderator

Apply this adjustment to all three <figure> sections and your code should pass the check cleanly! Also, double-check your opening <h1>Egypt</h2> tag at the top—you’ll want to make sure the closing tag matches (<h1>Egypt</h1>).

Hi @oliverbennet345,

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge. How to Help Someone with Their Code Using the Socratic Method

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.

Happy coding