Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Charlie Sattgast
7,205 PointsWhat about using a comment instead of negative right margin?
FOr creating a two-column layout it seems like the margin-right: -4px; method of removing the space between inline-block divs is a little messier than David Connor’s preferred method of inserting a comment between divs like so: </div><!--remove space --><div>
Any additional thoughts on this?
David Bath
25,940 PointsDavid Bath
25,940 PointsI have three minor issues with this. First, I think this goes against the principle of separation of concerns. The HTML should be concerned with the structuring the content, not affecting the presentation, which is the domain of CSS. Second, the comment method might be less "messy" in the CSS, but the HTML is more messy. And third, if there are multiple people working on a site, any one of them could accidentally add an extra space somewhere that will affect the layout when using this method.
These are all minor issues. But anyway, it looks like David Conner was promoting this technique several years ago before flexbox gained such wide support. Flexbox would be my preferred layout method now.
As an added note, I wonder if HTML minification would take care of the issue automatically by removing line breaks in the HTML? I haven't tested this.