CSS tab-size
The ridiculous tabs vs. spaces debate within code can get just as heated as the JavaScript semi-colon debate. I'm a tab guy myself but to each their own...just don't work on a project with me if you aren't. Anyways, I was quite surprised to find that you can set the tab space number of <pre> element code with CSS's tab-size
property!
The CSS
The tab-size
property takes an integer value representing the number of spaces a tab represents:
/* 4 spaces per tab */
pre {
tab-size: 4;
}
/* No indentation */
pre {
tab-size: 0;
}
As you can see, you could even remove indentation all together. Not recommended but possible.
I love this property as it's especially useful for code-heavy blogs, though it doesn't have much use outside of that.
Your early CSS books were instrumental in pushing my love for front end technologies. What was it about CSS that you fell in love with and drove you to write about it?
At first blush, it was the simplicity of it as compared to the table-and-spacer...
CSS cubes really showcase what CSS has become over the years, evolving from simple color and dimension directives to a language capable of creating deep, creative visuals. Add animation and you've got something really neat. Unfortunately each CSS cube tutorial I've read is a bit...
The following tools is in its very beta stages and works intermittently. Its so damn useful that I had to show it off now though!
I recently stumbled upon Downloadify, a client-side file generation tool based on JavaScript and Flash ActionScript code. A...
One subtle detail that can make a big difference on any web design is the use of image reflections. Using them too often can become obnoxious but using reflections on large, "masthead" images is a classy enhancement. Unfortunately creating image reflections within your...
Didn’t know about that.
It’s so basic that I wouldn’t be surprised if that was defined in CSS1.
But it’s a recent thing it seems, and still vendor prefixed. No sign of support in IE, as Microsoft stubbornly thinks that tabs are as huge as 8 spaces!
For vendor prefixes and browser support comparison: https://developer.mozilla.org/en/docs/CSS/tab-size