costaricaman
New Member
I'm keen to use \[code\]inline-block\[/code\] extensively as part of a fluid, responsive design, rather than lots of \[code\]float: left\[/code\] and clearfix hacks. Until HTML5/CSS3 provides a way of ignoring spaces, and everyone upgrades to browsers that support this new feature (i.e. maybe five years if we're lucky) there will always be problems making this kind of layout.There are a lot of hacks you can use to avoid the problem of browsers rendering space between inline-blocks: write code without spaces, comment out the spaces, some horrible font size hacks, etc. but None of them feel that great to me. I'm thinking instead of adding some inline JavaScript to the very bottom of my \[code\]body\[/code\] tag:\[code\]document.getElementById('base').innerHTML = document.getElementById('base').innerHTML.replace(/\x3e\s+\x3c/g, '\x3e\x3c');\[/code\]Essentially a post-hoc implementation of the "write code without spaces" implementation. I've tested it on a range of browsers and they all seem pretty happy with it - my question is: is there some grave hidden danger that I'm not seeing?I've created a demo here: http://jsfiddle.net/edwardc/wdz5t/Obviously there may be occasions when I actually want space - I can deal with those easily. And there might be issues with JavaScript bindings falling off - I'm pretty sure all my jQuery bindings will always attach after a script at the bottom of the body runs, and even if there's an issue, \[code\].on()\[/code\] should provide an easy fix.