105 posts
  • Has referred 10+ members
  • Has sold $5,000+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
DodoWeb says

Just wondering what’s your favourite tab size for HTML /PHP/CSS files?

I used to do it with 4 spaces in the past, but recently I noticed that most of the themes here are using 8 (even the twentyeleven theme). Is there some kind of standard for that?

Back in the days I remember that most of the programmers were using 8 spaces because of the word “function” which is exactly eight-character. However, I find it a bit strange to use 8-space-tab for indenting CSS files for example… How do you do it?

Niki / DodoWeb

898 posts
  • Has sold $1,000+ on Envato Market
  • Has referred 1+ members
  • Has collected 10+ items on Envato Market
  • Has been part of the Envato Community for over 3 years
+5 more
infuse01 says

I’m using 4 Spaces. I tried 2 Spaces some days ago but I couldn’t adapt to it – looks to stuffy. I stay with 4 Spaces :)

1284 posts
  • Has been part of the Envato Community for over 4 years
  • Has sold $40,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 50+ items on Envato Market
+5 more
Smartik says

I use 4 spaces – Notepad++ default.

105 posts
  • Has referred 10+ members
  • Has sold $5,000+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
DodoWeb says

4 spaces still looks fine for me, but I really wonder if there’s some kind of standard.. for WP theme-ing or in general.

70 posts Talk less do more!
  • Has referred 10+ members
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has collected 50+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+3 more
Rifki says

4 space or 1 hard tab more comfortable for me.

@DodoWeb

but I really wonder if there’s some kind of standard.. for WP theme-ing or in general.
http://blog.logtalk.org/2011/03/coding-guidelines-and-the-spaces-versus-tabs-holy-war/ http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html#whitespace-1 http://lxr.linux.no/linux/Documentation/CodingStyle
1617 posts Chris Robinson
  • Located in United States
  • Has sold $500,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 6 years
+10 more
contempoinc says

Four spaces is pretty much the standard.

105 posts
  • Has referred 10+ members
  • Has sold $5,000+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
DodoWeb says

Still bothers me why the WP guys (as well as many authors here) use 8-space tabs… They really don’t look sexy in CSS and HTML files.

653 posts
  • Has referred 50+ members
  • Has sold $40,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 100+ items on Envato Market
+5 more
UBLThemes says

4 spaces in php, html but it css i use only 2, dont ask me why ;p

just habit :)

333 posts
  • Has referred 100+ members
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 50+ items on Envato Market
+5 more
vtimbuc says

I don’t use spaces, I like using tabs with the same size as 4 spaces. If you use tabs and see the source code in the browser it looks like it’s 8 spaces. Maybe that is why you’re seeing so many themes that look like have 8 spaces, when they don’t :)

105 posts
  • Has referred 10+ members
  • Has sold $5,000+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
DodoWeb says

I also use tabs with that size, but I’m referring to the source code, not the generated HTML .

However, I just found that my editor (NetBeans) were expanding tabs to spaces by default.. so there we go.

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by