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.
CSS and JavaScript: the lines seemingly get blurred by each browser release. They have always done a very different job but in the end they are both front-end technologies so they need do need to work closely. We have our .js files and our .css, but...
If you follow me on Twitter, you know that I've been working on a super top secret mobile application using Appcelerator Titanium. The experience has been great: using JavaScript to create easy to write, easy to test, native mobile apps has been fun. My...
It's something that makes all men live in fear, and are often uncertain of. It's never spoken, but the curiosity is always there. Nine out of ten women agree in the affirmative. Advertisers do their best to make us feel inadequate but...
I'm a huge fan of WordPress' method of individual article deletion. You click the delete link, the menu item animates red, and the item disappears. Here's how to achieve that functionality with MooTools JavaScript.
The PHP - Content & Header
The following snippet goes at the...
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