- All code has custom tab size

On all websites, change the width of tab characters in code from the default 8 spaces wide to 4 spaces wide, or whatever other size you choose in the selector below. The setting affects all HTML <code> elements.

This is like my other style GitHub: better-sized tabs in code, but it applies to all websites. However, it only works on properly marked-up code – this may not work on some sites that present their code in an unusual way.

To use this style, install Firefox and Stylish. If you already have Stylish, make sure this site is allowed to run JavaScript.

(Though installing Stylish is recommended, if your browser supports user scripts, you can also install this style as a user script.)

All code has custom tab size
Author Rory O’Kane
License CC BY-SA
Created Jun 21, 2013
Updated Mar 18, 2015
Installs (this week) 1
Installs (total) 329
Show CSS


Here is the text in the screenshot. After installing this style, you can paste this text into the left box on to see the style in action:
(This is a site where you can write text and code on the left and see it rendered on the right.)

    	Tab-indented text in a code block

See – in the rendered HTML, the tab is four spaces wide, instead of the default eight. That text has a tab character before it, not four spaces.



No discussions posted yet. Be the first to ask a question or review this style.