Product Landing Page - Build a Product Landing Page

Tell us what’s happening:

ive tried everything i can think of i dont know why i keep getting errors on test 8 9 10

Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en"
<head>
  <meta charset="utf-8">  <link     rel="stylesheet"href="styles.css">
  <meta name= "viewport" content="width=device-width,intial-scale=1.0">
  <header id="header">
    <img id="header-img" src="https://www.pexels.com/photo/selective-focus-photography-of-orange-tabby-cat-1170986/"alt="orange cat"> 
 <nav id="nav-bar" class="nav-bar">
 </header> <ul> 
  <li> <a class="nav-link"> href="section id">section id</a>
  </li>
  <li><a class="nav-link href="section id">section id</a></li>

<li><a class="nav-link"href="section id">section id</a>
</li>
</nav>  
<iframe  id="video"src= "https://www.youtube.com/watch?v=myiwU0PbXX0&pp=ygUTaG9vZiB0cmltaW5nIGtuaWZlcw%3D%3D" titie= "how to trim a hoof"> </iframe>
<form id="form" action="https://www.freecodecamp.com/email-submit">
<input id="email"type="email" name="email" placeholder="email">
<input id="submit" type="submit">
<div class="flex-container">
  <img
src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/1.jpg" >
<img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/2.jpg">
</div>
/* file: styles.css */
header{width:100%;position:fixed;
top: 0;left: 0;
background-color: #cc0000 color: white;}
@media(30cm<= width<= 50cm){/*   */}
.flex-container img{width:50%; hieght: 50px;background-color: blue;border: red;display:flex;}*{box-sizing: content-box;}

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36

Challenge Information:

Product Landing Page - Build a Product Landing Page

did you post the full html file above? it seems to be broken and missing many tags?

Use this online html validator if you don’t know what I’m referring to:

Fix all the errors and if you still need help, please repost the corrected code in your reply to me.

<      !DOCTYPE htm
      <html lang="en">
      <head>
        <meta name= "viewport" content="width=device-width,intial-scale=1.0">
<meta charset="utf-8">  
 <title> creating a landing page</title>
  <link rel="stylesheet" href="styles.css">  <header id="header">
    <img id="header-img" src="https://www.pexels.com/photo/selective-focus-photography-of-orange-tabby-cat-1170986/" alt="orange cat"> 
 <nav id="nav-bar" class="nav-bar"> </header><ul> 
  <li class="nav-link"> <a  href="bad girl">bad girl </a>
  </li>
  <li class="nav-link"> <a href=" home">home</a></li>

<li class="nav-link" ><a href="suck my dick ">suck my dick</a>
</li>
</nav>  
<iframe id="video" src= "https://www.youtube.com/watch?v=myiwU0PbXX0&pp=ygUTaG9vZiB0cmltaW5nIGtuaWZlcw%3D%3D" title= "how to trim a hoof"> </iframe>
<form id="form" action="https://www.freecodecamp.com/email-submit">
<input id="email"type=" email" name="email" placeholder="email">
<input id="submit" type="submit">
<div class="flex-container">
  <img
src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/1.jpg" alt="slepping cat" >
<img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/2.jpg" alt="playing cat">
</div>

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

this code still looks broken?
(has many issues to fix still)
Please use the link I gave you before and paste your code in the validator to see all the errors that need fixing.

i fixed as many eroors as i could but one of them was i had a closing header tag but no opener but if i move the header tag it fails one of the test i also had the same issue for the nav element errors what do i do

maybe your fixes are not quite correct.
Can you give me an example of an error and what you thought was the correct fix?
(so show me the error message by copying it and pasting it here and then explain what change you did to fix it and how you believe that causes a problem for the test).

You may want to just fix everything first and get a clean html before even attempting the fCC test too.

  1. Error: End tag header seen, but there were open elements.From line 19, column 1; to line 19, column 9li>↩</ul>↩</header>↩</nav
    i tried to fix this by moving the header endtag ext to the open tag but when i did that the test said that the nav tag had to be decendent of the header

the second error was 1. Error: Unclosed element nav.From line 10, column 2; to line 10, column 18cat"> ↩ ↩ <nav id =nav-bar>↩ <ul>i dont understand this because the next error is 1. Error: Stray end tag nav.From line 20, column 1; to line 20, column 6</header>↩</nav> ↩<if so i put the closing tags for the nav element closer together and it still didnt work

here is the code i tried to do the little back tick thing but all that happens is a blue highlight bounces around the window

creating a landing page orange cat
slepping cat playing cat

hey remember to format your code in between 2 lines of backticks like this:
```
code here
```

so we can see it!

i tried that all it does is bounce around every time i hit the back tic button

<!DOCTYPE html>
<html lang="en">
<head>
  <meta name= "viewport" content="width=device-width,intial-scale=1.0">
<meta charset="utf-8">  
 <title> creating a landing page</title>
  <link rel="stylesheet" href="styles.css">  <header id="header">
    <img id="header-img" src="https://www.pexels.com/photo/selective-focus-photography-of-orange-tabby-cat-1170986/" alt="orange cat"> 
 
 <nav id =nav-bar>
 <ul> 
  <li class="nav-link"> <a  href=bad>bad  </a>
  </li>
  <li class="nav-link"> <a href= home>home</a></li>

<li class="nav-link" ><a href=suck >suck</a>
</li>
</ul>
</header>
</nav>  
<iframe id="video" src= "https://www.youtube.com/watch?v=myiwU0PbXX0&pp=ygUTaG9vZiB0cmltaW5nIGtuaWZlcw%3D%3D" title= "how to trim a hoof"> </iframe>
<form id="form" action="https://www.freecodecamp.com/email-submit">
<input id=email type=email name=email placeholder=email>
<input id="submit" type="submit"></form>
<div class="flex-container">
  <img
src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/1.jpg" alt="slepping cat" >
<img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/2.jpg" alt="playing cat">
</div>
1 Like

so if you scroll down in that html validator page after you’ve pasted your code in to check, you will see something like this:

we can see that the first error is the </header> which doesn’t close anything.
So for now, we can remove that closing tag. (even if fCC wants a header, we can come back and add one later after the html is fixed).
So I removed that </header> and the other header tag

This got rid of all the errors.

Now we can go back and look at what fCC wants and work with a clean html.
Give that a try (remove those 2 things and check).

Also don’t forget to add the closing tag for the html element in the last line of your index.html.

ps. you are also missing the closing tag of your head element. So please add that after your last link element and before the ‘body’ of your code begins.
You really should also define the body element too.

ok html code is clean the fcc wants
3. Your #header-img should be a descendant of the #header .
7. Your #nav-bar should be a descendant of the #header .
9. Each .nav-link element should have an href attribute.
10. Each .nav-link element should link to a corresponding element on the landing page (has an href with a value of another element’s id. e.g. #footer ).

<!DOCTYPE html>
<html lang="en">
<head>
  <meta name= "viewport" content="width=device-width,intial-scale=1.0">
<meta charset="utf-8">  
 <title> creating a landing page</title>
  <link rel="stylesheet" href="styles.css">
 </head>   
    <img id="header-img" src="https://www.pexels.com/photo/selective-focus-photography-of-orange-tabby-cat-1170986/" alt="orange cat"> 
 
 <nav id =nav-bar>
 <ul> 
  <li class="nav-link"> <a  href=bad>bad  </a>
  </li>
  <li class="nav-link"> <a href= home>home</a></li>

<li class="nav-link" ><a href=suck >suck</a>
</li>
</ul>

</nav>  
<iframe id="video" src= "https://www.youtube.com/watch?v=myiwU0PbXX0&pp=ygUTaG9vZiB0cmltaW5nIGtuaWZlcw%3D%3D" title= "how to trim a hoof"> </iframe>
<form id="form" action="https://www.freecodecamp.com/email-submit">
<input id=email type=email name=email placeholder=email>
<input id="submit" type="submit"></form>
<div class="flex-container">
  <img
src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/1.jpg" alt="slepping cat" >
<img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/2.jpg" alt="playing cat">
</div>
</html>

so you’ll need a body element.
Put all the code that is not in the head element inside the body element.
Then you’ll need to work on each of the requests one by one.
Do you know what the header is supposed to be for? (and where it should go?)

yes i think i can do that

ive done everything i can think of but i cant get the fcc to pass 9. Each .nav-link element should have an href attribute. and
Failed:10. Each .nav-link element should link to a corresponding element on the landing page (has an href with a value of another element’s id. e.g. #footer).

<!DOCTYPE html>
<html lang="en">
<head>
  <meta name= "viewport" content="width=device-width,intial-scale=1.0">
<meta charset="utf-8">  
 <title> creating a landing page</title>
  <link rel="stylesheet" href="styles.css">
 </head>   
  <body>
  <header id=header>
    <img id="header-img" src="https://www.pexels.com/photo/selective-focus-photography-of-orange-tabby-cat-1170986/" alt="orange cat"> 

 <nav id =nav-bar>
 <ul> 
  <li class="nav-link"> <a  href="bad">bad  </a>
  </li>
  <li class="nav-link"> <a href= "home">home</a></li>

<li class="nav-link" ><a href="suck" >suck</a>
</li>
</ul>

</nav>  
<iframe id="video" src= "https://www.youtube.com/watch?v=myiwU0PbXX0&pp=ygUTaG9vZiB0cmltaW5nIGtuaWZlcw%3D%3D" title= "how to trim a hoof"> </iframe>
<form id="form" action="https://www.freecodecamp.com/email-submit">
<input id=email type=email name=email placeholder=email>
<input id="submit" type="submit"></form>
<div class="flex-container">
  <img
src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/1.jpg" alt="slepping cat" >
<img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/2.jpg" alt="playing cat">
<section id="bad">
<h2> bad</h2>
<p> the name of my cat is bad girl</p>
</section>
<section id="home">
<h3> home</h3>
<p> my second cats name is home girl.</p>
</section>
<section id="suck">
<h4>suck</h4>
<p> my oldest cats name is sucks her name was supoosed to be socks but all i could say when i got her is sucks.</p>
</section>
</div>
</header>
</body>
</html>

hi there!

remove that extra white space after `

and add # before each href=#value.

1 Like

so i tried running that and i got the same test that failed can you see anything

<html lang="en">
<head>
  <meta name= "viewport" content="width=device-width,intial-scale=1.0">
<meta charset="utf-8">  
 <title> creating a landing page</title>
  <link rel="stylesheet" href="styles.css">
 </head>   
  <body>
  <header id=header>
    <img id="header-img" src="https://www.pexels.com/photo/selective-focus-photography-of-orange-tabby-cat-1170986/" alt="orange cat"> 

 <nav id =nav-bar>
 <ul> 
  <li class="nav-link"><a  href="#bad">bad</a>
  </li>
  <li class="nav-link"><a href="#home">home</a></li>

<li class="nav-link"><a href="#suck">suck</a>
</li>
</ul>

</nav>  
<iframe id="video" src= "https://www.youtube.com/watch?v=myiwU0PbXX0&pp=ygUTaG9vZiB0cmltaW5nIGtuaWZlcw%3D%3D" title= "how to trim a hoof"> </iframe>
<form id="form" action="https://www.freecodecamp.com/email-submit">
<input id=email type=email name=email placeholder=email>
<input id="submit" type="submit"></form>
<div class="flex-container">
  <img
src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/1.jpg" alt="slepping cat" >
<img src="https://cdn.freecodecamp.org/curriculum/css-photo-gallery/2.jpg" alt="playing cat">
<section id="bad">
<h2> bad</h2>
<p> the name of my cat is bad girl</p>
</section>
<section id="home">
<h3> home</h3>
<p> my second cats name is home girl.</p>
</section>
<section id="suck">
<h4>suck</h4>
<p> my oldest cats name is sucks her name was supoosed to be socks but all i could say when i got her is sucks.</p>
</section>
</div>
</header>
</body>
</html>

You are missing the quotes around the id’s

e.g.

wich ids are qoutetation