</head> and <body> tags see error below to fix the issue


#1

:relaxed:


My code looks like this:
<!DOCTYPE html>
<html>
    <head>
        <title>Intrepid Student</title>
    </head>
<body style="background-color:green">
<h1 style="font-family:Arial;background-color:blue;color:white;font-size:40px"><i>Koby Anno-Asante's Website</i></h1>
<p style="font-size:20px;background-color:violet">As of October, this year I started learning coding on <a herf="https://wwww.codecademy.com/"><strong;p style="color:white">codecademy.</strong></a></p>
<p style="font-size:20px;background-color:red;font-family:Georgia,sans-serif">I'm so glad I found this amazing website, because I always wanted to make my own website. As you can see an image of a ninja.</p>
<img src="http://s3.amazonaws.com/codecademy-blog/assets/ninja_zpsa5dbe37a.jpg" />
<p style="font-size:20px;background-color:Darkorange;">I'm a <strong; p style="font-size:23px;color:white">hard-worker, self-disciplined, sporty, nice, and humble</strong> too. </p>
</body>
</html>

It says this message below, as I think there's is nothing wrong with the code I entered:

Oops, try again. Make sure your tag comes before your tag! Oops, try again. Make sure your tag comes before your tag!

Please help me to resolve this issue
Thanks,
Koby


#2

This does not look right.


#3

Unfortunately, it still does not work if I remove it. :sweat:


#4

Does this project have a style.css tab? If so, move all your CSS over to there so you have only HTML on the index.html page.


#5

Nope it does not include the style.css tab :confused:


#6

Please post a link to the project so we can look things over.


#7


There you go


#8

Highlighted some of your errors.

herf Should be href

This will never work, it is simply bad.
Perhaps you should change it too:
<strong style="color:white">codecademy.</strong>

Should be:

<strong style="font-size:23px;color:white">hard-worker, self-disciplined, sporty, nice, and humble</strong>

Hope this helps!


#9

Found one more thing, they don't understand <body style="background-color:green">
So change that to <body>


#10

It still doesn't allow me to continue on with the lesson. Even thought I have corrected the errors :disappointed:


#11

Did you see this post?


#12

Awesome mate. You actually resolved the issue. Thank you very much :relieved:


#14

Then the thing to do is embed a style sheet so you don't have all those style attributes cluttering things up.

In the <head> section, add a <style></style> element and put all your style rules in there.

<style>
body {
  background-color:green;
}
h1 {
  font-family: Arial;
  color: white;
  background-color: blue;
  font-size: 40px;
}
p {
  font-size: 20px;
}
p:nth-of-type(1) {
  background-color: violet;
}
p:nth-of-type(2) {
  background-color: red;
  font-family: Georgia, sans-serif;
}
p:nth-of-type(3) {
  font-size: 20px;
  background-color: Darkorange;
}
p:nth-of-type(3) strong {
  font-size: 23px;
  color: white;
}
</style>

Now remove all those style attributes.


#15

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.