Skip to content

Fix overflowing text in Cards with word-wrap: break-word#22740

Merged
mdo merged 1 commit intotwbs:v4-devfrom
pat270:card-title
Jun 4, 2017
Merged

Fix overflowing text in Cards with word-wrap: break-word#22740
mdo merged 1 commit intotwbs:v4-devfrom
pat270:card-title

Conversation

@pat270
Copy link
Contributor

@pat270 pat270 commented Jun 1, 2017

Demo: https://jsfiddle.net/4h6okLkn/2/

Long text with no whitespace overflow in cards, this fix should cover most long text in cards. I used word-wrap: break-word instead of word-break: break-all because it breaks up the words a little bit better.

@mdo
Copy link
Member

mdo commented Jun 2, 2017

I feel like adding this to the entire card would be overdoing it. How does this interact with more complex card contexts, subcomponents, etc? Wondering if it'd be better to make this an easier utility or apply it to multiple card classes.

@pat270
Copy link
Contributor Author

pat270 commented Jun 2, 2017

Hey @mdo,

I think having it on the entire card is the right thing to do. It makes all the card sub components function like they should e.g. .card-groups and .card-decks retain equal widths even with long text. .card-columns also works like it should.

It wasn't working in some of the sub components because I missed adding min-width: 0 to .card so the browser uses the card's width instead of the content's width when deciding if it should break-word.

@mdo mdo added this to the v4.0.0-beta milestone Jun 4, 2017
@mdo mdo merged commit 891bca4 into twbs:v4-dev Jun 4, 2017
@mdo mdo mentioned this pull request Jun 4, 2017
@mdo mdo marked this as a duplicate of #23061 Jul 14, 2017
mdo added a commit that referenced this pull request Dec 23, 2017
mike-odom pushed a commit to mike-odom/bootstrap that referenced this pull request Dec 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants