Can I use tabs for my indentation rather than two spaces?


#1

Question

Can I use tabs for my indentation rather than two spaces?

Answer

There is no official standard on how many spaces or tabs to indent by within our HTML documents. So long as you are consistent, you may use tabs rather than spaces if you prefer. That having been said, 2 space indentation is very common and adheres to Google’s HTML style guide.


FAQ: Learn HTML Elements - Common HTML Elements - Indentation
FAQ: Learn HTML Elements - Common HTML Elements - Linking to Same Page
#2

Many IDEs will translate a tab into a given number of spaces instead of inputting the normal
tab invisible character. There is an ongoing debate in programming regarding the use of tabs vs. spaces. I think spaces is at least a little more common in general.


#3

absolutely true, soft tabs vs hard tabs. Soft tabs (the tab key insert spaces) seems favorable, which make sense given it works better when different developers on the same project use there own preferred editor.