Html and Css indention


#1

how do i indent with Html ?


#2

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

Thx this really helped allot.


#4

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


#5

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


#6

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


#8

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