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

CSS grid doesn't support word-wrap, overflow-wrap and hyphens properties #46

Open
danielCSS opened this issue Jul 10, 2018 · 1 comment

Comments

@danielCSS
Copy link

danielCSS commented Jul 10, 2018

Long words don't break to the next line where template column widths are defined with fr units

Codepen #1: (word-wrap / overflow-wrap)

Codepen #2: (hyphens)

Workarounds:

  1. use minmax() function instead of fr units. eg:

grid-template-columns: minmax(0, 1fr); instead of

grid-template-columns: 1fr;

  1. use the word-break property
    For chrome: word-break: break-word is sufficient, but firefox requires word-break: break-all - which has the unwanted effect of breaking words in the middle.

For reference, see: https://stackoverflow.com/questions/51253050/css-grid-grows-over-100-width-with-fr-but-not-with-minmax

@marcing
Copy link

marcing commented Jul 19, 2023

+1

Thanks for the workaround Daniel!

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

No branches or pull requests

2 participants