I'm trying to make tabs with labels that are sometimes two lines. I started out with a ul
method, but switched to flexbox
hoping to solve two problems: (1) get the tabs to fill the width of the container, and (2) vertically center the labels. Width-filling worked, but centering didn't.
Everybody says justify-content:center
and align-items:center
will do what I want, but they apparently act only on the boxes themselves, not the text inside them. To horizontally center the text, I can use text-align: center
, but there is nothing I can find that will center it vertically. One rumor mentioned align-content:center
but that also has no effect. Here is the Codepen I have been playing in: https://codepen.io/OsakaWebbie/pen/mdVrMYK All the lines with /* nope */
are things I tried in vain based on various rumors.
What am I missing? (Sometimes I miss the days when we used tables for layout, in which this would be a piece of cake...)