Learn HTML and CSS course


#1

Hi, I was going through the HTML and CSS. I couldn't understand the spacing and indentation. feature please help with some example.


#2

Spacing and indentation is something which the browser is impartial to. In terms of visibility, it makes no difference. However, it is much easier to see what is nested in what if we have:

<!DOCTYPE html>
<html>
  <head>
    <title>This is an example</title>
  </head>
  <body>
    <p> "While, it is easy to see that this paragraph is in the body,
        and the title is in the head and everything is in html, it isn't quite
        so easy if we write it like the next bit of code. As we increase the length, 
        it becomes exponentially more difficult." </p>
  </body>  
</html>

instead of:

<!DOCTYPE html>
<html>
<head>
<title> This is an example </title>
</head>
<body>
<p>
"This can cause all sorts of problems if somebody else checks your code."
</p>
</body>
</html>

#3

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