Html and Css indention

how do i indent with Html ?

The typical indentation in HTML and CSS files is 2 spaces per nesting level. CSS is simple, since there is no nesting (unless writing Sass) beyond the first level.

selector {
  display: block;
  margin: 0;
}

HTML can have many nested levels. hence the 2 space indent, and not 4, and not TAB.

<body>
  <div>
    <h1></h1>
    <div>
      <h2></h2>
      <p></p>
      <ul>
        <li></li>
        <li></li>
        <li></li>
      </ul>
    </div>
  </div>
</body>
3 Likes

Thx this really helped allot.

1 Like

One more question, is CodeCademy an app I can download on iPod and/or ps4

Not to my knowledge. I believe it is primarily a desktop interface, and may work with some tablets (can’t say that for sure).

1 Like

Ok thx and I’ve tried it on tablets it really doesn’t wait on anything but computer, I’ve tried it on ps4 too and it worked but that’s because the Internet on ps4 is like a computers Internet

1 Like

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