About the indentation in CSS


#1

<PLEASE USE THIS TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<In CSS section 7: Indentation and Spacing>

It says ‘two spaces of indentation should be used for CSS declarations’ I don’t understand how this works? Where should I put the two spaces? Please help me out, thanks!


#2

So I believe this is referring to the lines of CSS code in your heading paragraph etc. sections. For example:

h1 {
  color: FireBrick;
}
p {

Under header 1 or h1 color is your CSS declaration with firebrick as the color. Notice it is spaced 2 spaces from where the h1 is located.


#3

Yes I see it. So basically the two spaces indentation is just a format for CSS declaration, it doesn’t apply to the final results in the browser right?


#4

Correct. Because that spacing has nothing to do with what is actually shown on the font color but to have it correctly space according to rules and to have it neatly organized, the spaces are used.


#5

Totally got it, thanks a lot for explaining!


#6

No problem! Glad to have been of service! :+1:


#7

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