I have a project for implementation that should have a centered column of labels, and then text to the left of each. It should look like this:

The label column should be centered under the heading.
I can't get this to work with responsive design. This markup has an ATM:
<div class="ax-learn__shortcuts">
<h2>Learn shortcuts</h2>
<div class="ax-learn__shortcuts-row">
<div>Go to home:</div>
<div><kbd>g</kbd>then<kbd>h</kbd></div>
</div>
<div class="ax-learn__shortcuts-row">
<div>Go to search:</div>
<div><kbd>g</kbd>then<kbd>s</kbd></div>
</div>
<div class="ax-learn__shortcuts-row">
<div>Go to learn:</div>
<div><kbd>g</kbd>then<kbd>l</kbd></div>
</div>
And the current CSS, which doesn't center it at all, is this:
.ax-learn__shortcuts {
display: flex;
flex-direction: column;
}
.ax-learn__shortcuts h2 {
text-align: center;
}
.ax-learn__shortcuts-row {
display: flex;
justify-content: center;
align-items: center;
}
And here is an example on Codepen
source
share