Stuck at Whitespace lesson


#1

Its there anything wrong with my program?
when I run the program, I received this memo"did you add whitespace to your index.html file?"

<!DOCTYPE html>
<html>
  <head>
    <title>Khairul Coding Journal</title>
  </head>
  <body>
    <p>Shall I compare thee to a summer's day? <br/>Thou art more lovely and more temperate</p>
  </body>
  <body>
    <div>
      <p>This paragraph is a child of the div element</p>
    </div>
  </body>
  <body>
    <p>This paragraph is a child of the body element</p>
  </body>
  <body>
	<p>Paragraph 1</p>
	<p>Paragraph 2</p>
	</body>
</html>

https://www.codecademy.com/courses/learn-html-elements/lessons/intro-to-html/exercises/white-space-html?action=lesson_resume&course_redirect=learn-html


#2

Hi @yokhafiz,

It would be best if you can provide the exercise’s link and state which step you’re facing difficulty so others can have a look on exercise and offer more help. From the current code you provided, you probably have too much of <body></body> tags. You just need one <body></body> tag in one html structure.

<html>
  <head>
    <title></title>
  </head>
  <body>

     <!–– anything in between ––> 

  </body>
</html>

And notice your <br/> tag, it should be <br> tag, example:


#3

Tq for your advise. already add the link… tqvm
I think <br>and <br/>same element function


#4

Hi @yokhafiz,

I think you might need to consider logging off and clearing your browser cache, cause I followed the link you provided, the code provided by the lesson is totally different from what you posted.

Maybe consider using another browser to log-in through that link then you will understand what I’m talking about.

The code I see from the lesson is something like this:

..... some code above....

<h1>Whitespace</h1>
    <p>Whitespace and indentation make html documents easier to read.</p>

.... some code below....

which is totally different from yours. As a note, I’ve passed that lesson, so the code I’m seeing should be working.


#5

https://www.codecademy.com/courses/learn-html-elements/lessons/intro-to-html/exercises/indentation-html?action=lesson_resume&course_redirect=learn-html

**Thanks for helping,I already add the program that you gave to me but still have error, hence I attach new link to you. **


#6
<!DOCTYPE html>
<html>
  <head>
    <title>My coding journal</title>
  </head>
  <body>
    <p>Shall I compare thee to a summer's day?<br>Thou art more lovely and more temperate</p>
    <div>
      <p>This paragraph is a child of the div element</p>
    </div>
    <p>This paragraph is a child of the body element</p>
    <h1>Whitespace</h1>
    <p>Whitespace and indentation make html documents easier to read.</p>
  </body>
</html>

https://www.codecademy.com/courses/learn-html-elements/lessons/intro-to-html/exercises/white-space-html?action=lesson_resume&course_redirect=learn-html

Below there is a new program I write but still failed at Whitespace lesson(‘Did you add whitespace to your index.html file?’). Please help.


#7

@yokhafiz,

Which one is the link you’re having problem with exactly?

The above are two different links with two different lessons using two different code. One is lesson 11 about whitespace, and one is lesson 12 about indentation, the two lessons will provide different code inside your CC code editor. Please clarify your question so it doesn’t not sound confusing.

You misunderstood me, what I’m saying the code you posted all of it is not from the whitespace lesson:

Here, this is the full code supposed given to you:

<!DOCTYPE html>
<html>
  <body><h1>Whitespace</h1><p>Whitespace and indentation make html documents easier to read.</p></body>
</html>

Then, follow the instruction from the lesson:

Use whitespace to make the code more readable by putting each element on its own line.

Delete all of your previous code, paste the code I posted, and edit the code so that it follows the instruction.

That should solve your situation.


#8

link with lesson 11 whitespace


#9

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