FAQ: Learn HTML - Intro to HTML - Divs

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

FAQs on the HTML exercise Divs

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!

1 Like

Other FAQs

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

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).

2 Likes

4 posts were split to a new topic: Why should we use divs if they don’t change anything visually?

7 posts were merged into an existing topic: Why should we use divs if they don’t change things visually?

2 posts were split to a new topic: Should I start by learning HTML?

A post was split to a new topic: How can I add a line in HTML

2 posts were split to a new topic: I’m having a syntax error

2 posts were split to a new topic: Why should I group elements with div?

2 posts were split to a new topic: Can you type more than one code per line?

hello there, i was wondering the effect of div tag only happens on the written code or it has effect when we execute our code ?

When inserting a div around elements, is it necessary to indent the closing div? Or should there just be a space between the opening div and the rest of the element? How exactly does this improve readability?

Consider,

<div><div><div><div><div></div></div></div></div></div>

How readable is that? Yet, the browser has no problem disseminating it.

No white space was used at all, yet those DIVs will all render accordingly. What’s more, CSS and DOM script can narrow in on any one of them.

White space has practically no meaning in HTML. By ‘practiclally’ we mean that one space will be rendered in all cases.

<p>here is       some text</p>

<- here is some text

<p>here is
some text</p>

<- here is some text
1 Like

Thank you very helpful.

1 Like