DEV Community

loading...

Discussion on: Default 4px spacing between inline elements

Collapse
mikesusz profile image
Mike Susz

have you tried using tabs to indent instead of spaces?

spaces have layout in inline rendering, tabs are completely ignored by the browser.

since the days of IE* (hasLayout property) this has been my argument for indenting browser code (html) with tabs instead of spaces.

Collapse
redmer profile image
Redmer

Whoa, that settles the incessant debate (no it won't)

Collapse
mikesusz profile image
Mike Susz

nothing will ever settle the tabs/spaces debate :) and packaging/minifying tools will take care of problems like this, but also introduce aberrations where what we see in our development environment may not exactly match what ends up in production.

Collapse
tyzia profile image
Andrei Navumau Author

Hi Mike,

That's a great idea.

My code editor settings are set up so that even if I use tabs, it inserts 4 spaces instead. I'm not ready to switch to pure tabs, because coding rules of different companies require using spaces instead of tabs. I try to stick to this practice.

Moreover, it seems to me, that 4px space is generated not because of spaces in indentation, but due to line feed.

Collapse
mikesusz profile image
Mike Susz

i'm telling stories from long ago; back before we had (good) CSS layout we had to recognize what characters the browsers regarded as having layout and which they don't. things have have changed on me :)

Collapse
mikesusz profile image
Mike Susz

hmm okay the RFC proves me wrong.

w3.org/TR/REC-html40/struct/text.h...

apparently i relied on this for years when browsers would ignore them.

i stand corrected. thanks for your workarounds. :)

Forem Open with the Forem app