FAQ: Learn HTML - Common HTML Elements - Preparing for HTML

This community-built FAQ covers the “Preparing for HTML” exercise in Codecademy’s lessons on HTML.

Here are the most popular community questions on the exercise Preparing for HTML:

Join the Discussion. We Want to Hear From You!

Have a new question or can answer someone else’s? Reply (reply) to an existing thread!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources about HTML in general? Go here!

Want to take the conversation in a totally different direction? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account, billing, Pro, or Pro Intensive? Reach out to our support team!

None of the above? Find out where to ask other questions here!

Other FAQs

The following are links to additional questions that our community has asked about this exercise:

  • This list will contain other frequently asked questions that aren’t quite as popular as the ones above.
  • Currently there have not been enough questions asked and answered about this exercise to populate this FAQ section.
  • This FAQ is built and maintained by you, the Codecademy community – help yourself and other learners like you by contributing!

Not seeing your question? It may still have been asked before – try searching for it by clicking the spyglass icon (search) in the top-right of this page. Still can’t find it? Ask it below by hitting the reply button below this post (reply).

1 Like

2 posts were split to a new topic: What does “document type” mean?

4 posts were split to a new topic: Why is “DOCTYPE” uppercase but “html” lower?

Can <!DOCTYPE html> be <!DOCTYPE html /> or is that a no-no?

Look up the doctype for XHTML and go by that. If it doesn’t have a self closing tag, then it would qualify as a ‘no-no’.

It’s fair to assume that XML syntax would not come into play until the doctype is declared, so the reasonable assumption would be that no space, and/or slash would be recognized by the user agent.

In the lecture it says

In the future, however, a new standard will override HTML5. To make sure your document is forever interpreted correctly, always include <!DOCTYPE html> at the very beginning of your HTML documents.

So why don’t I write <!DOCTYPE html5 or something like that? Won’t future things, like HTML6 use “html” as well?

HTML is a living language which will continue to evolve into newer iterations. The latest recommendations will always be the de facto for newer browser versions. That means we never have to change the doctype again. It will always be,

<!DOCTYPE html>

or whichever variation of that your style guide recommends.

1 Like

Thanks for the fast response.
My train of thought was something like: What if
in future iterations of html no longer means line breaks. Then my code would no longer work. But I guess people wouldn’t just change currently already used syntax, but rather invent new ones.

1 Like

That has always been the case. It’s known as backward compatibility.

There are some exceptions, such that elements and attributes can eventually become deprecated or obsolete, preventing the document from being validated. It won’t have a detrimental effect, though, as the browser will simply ignore it. HTML is rendered as best it can be by any browser.

1 Like