Spacing to keep it organzed


#1

NEVER MIND THIS QUESTION. I WAS TRYING TO SHOW THE HTML CODE, BUT NO CODE APPEARED IN THE POST BELOW…

In regards to the spacing when adding “children,” is it ok to have the paragraph spaced like i did below?

<div id="introduction">
    <h2>About Brown Bears</h2>
      <p>The brown bear (Ursus arctos) is native to parts of northern Eurasia and North America. Its conservation status is currently Least Concern. There are many subspecies within the brown bear species, including the Atlas bear and the Himalayan brown bear.</p>

OR, should the <p> be flush with the<h2>, so it look like this?

<div id="introduction">
    <h2>About Brown Bears</h2>
    <p>The brown bear (Ursus arctos) is native to parts of northern Eurasia and North America. Its conservation status is currently Least Concern. There are many subspecies within the brown bear species, including the Atlas bear and the Himalayan brown bear.</p>

#2

Not really, since it implies that the P element is nested in the H2, which it is not. They are sibling elements that should have the same level of nesting in order to read properly. Your second example is correct.

Because there can be so many levels of nesting, it is better to use two spaces, rather than four in HTML markup.

<div id="introduction">
  <h2>About Brown Bears</h2>
  <p>The brown bear (Ursus arctos) is ...</p>

Aside

Please remember to include a link to the exact exercise you are referring to so we are all on the same page (can read the instructions and test the code). Thanks.


#3

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