I searched on Google but couldn't find an answer. I'd like to know what are the standard tab sizes for HTML and CSS. Is it 2 or 4?
Asked
Active
Viewed 2,394 times
-3
-
**[Unclear what help you need](http://meta.programmers.stackexchange.com/questions/6559/why-is-research-important).** Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it’s hard to tell what problem you are trying to solve or what aspect of your approach needs to be corrected or explained. See the [ask] page for help clarifying this question. – gnat Jul 03 '15 at 14:24
-
1possible duplicate of [Tabs versus spaces—what is the proper indentation character for everything, in every situation, ever?](http://programmers.stackexchange.com/questions/57/tabs-versus-spaces-what-is-the-proper-indentation-character-for-everything-in-e) – rink.attendant.6 Jul 03 '15 at 16:53
2 Answers
2
Tabs have no innate size, their interpretation is up to the observer. If you're the observer, you get to decide how you want to view your tabs, or if you're using other kinds of whitespace, however many you want to have.
The syntax in the CSS specification uses [ \t\r\n\f]+
(one or more of the bracketed things) for whitespace, implying that the kind of whitespace is irrelevant.
Similarly, HTML5 defines space characters
as:
Any of the following:
U+0020 SPACE
U+0009 CHARACTER TABULATION (tab)
U+000A LINE FEED (LF)
U+000C FORM FEED (FF)
U+000D CARRIAGE RETURN (CR)

Lars Viklund
- 2,106
- 1
- 17
- 14
2
As I understand you're asking about indentation. There is currently no standard concerning indentation in HTML and CSS files. Nor should there be any. Let your editor software worry about the indentation.

Alternatex
- 1,033
- 2
- 13
- 24