Center wrapped items in a space-between flexbox

后端 未结 2 2252
忘了有多久
忘了有多久 2021-02-14 10:46

For a navigation section, I want it to use space-between justification. For smaller displays where the navigation might have to wrap, I\'d like the items to center

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-14 10:58

    LGSon's comment makes sense to me, but presumably OP wants the ability to modify dynamic text that may or may not fit in a container, regardless of flexbox config or media query.

    Look into JS that detects line wraps, then triggers an action (e.g. centering the text).

    For example: https://github.com/xdamman/js-line-wrap-detector

    Or, JS that automatically resizes text to fit within a container. Useless for all kinds of situations.

    For example: http://www.fittextjs.com

提交回复
热议问题