Why is that? I was under the impression you can do so with a percent width?
See the example below:
.amphead__branding-center {
width: 55%;
height: 3.5rem;
margin: 0 auto;
border-radius: 15px;
background-color: green;
}
.amphead__center-logo {
width: 30%;
display: flex;
flex-direction: column;
flex-basis: auto;
align-content: center;
justify-content: center;
font-family: serif;
background-color: #000;
color: #fff;
}
.engineering {
font-family: 'Source Sans Pro', sans-serif;
background-color: $main-amp-color;
color: lighten($grate-color, 2%);
}
<div class="amphead__branding-center">
<div class="amphead__center-logo">
<span>Main header</span>
<span class="engineering">Sub Header</span>
</div>
</div>
Howcome "main header" and "sub header" aren't in the center?
These resources suggest what I'm doing should work
https://css-tricks.com/snippets/css/a-guide-to-flexbox/
https://css-tricks.com/snippets/css/a-guide-to-flexbox/
Flexbox: center horizontally and vertically
What's the problem?