Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why the inline-block on the .grid? #22

Closed
ShaggyDude opened this issue May 26, 2016 · 1 comment
Closed

Why the inline-block on the .grid? #22

ShaggyDude opened this issue May 26, 2016 · 1 comment
Labels

Comments

@ShaggyDude
Copy link

I see you are using inline-block on the grid with some negative letter-spacing stuff to remove extra space. Why not just use display:block? I have never seen this trick but, it seems to work fine. Can you point me to where you picked it up?

@leejordan
Copy link
Owner

inline-block has the most in common with flex in that an inline-block layout gives you the ability to align elements vertically and horizontally. It made sense to use that as a fallback so that older browsers would still be able to have a mostly intact layout where flexbox is not supported.

Here's an explanation that gives a bit more info: http://www.lendmeyourear.net/layering-css-so-we-can-use-flexbox-now.html

As for the letter-spacing hack I chose that because in my opinion it is the most reliable hack for inline-block layouts for removing white space between elements. No hacks are ideal obviously but for me it's the one that works the best across as many browsers as possible.

This letter spacing hack was used in the Yui grid which is where I learnt about it: http://yuilibrary.com/yui/docs/cssgrids/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants