how to fix flex-direction: column; alignment here

.intro__area { grid-column: span 6; display: flex; flex-direction: column; gap: 2rem; }
No description
14 Replies
b1mind
b1mind6d ago
need more to go on please provide a codepen or demo of the issue its the best way
b1mind
b1mind6d ago
you only have one child intro__area > pre__header you need the flex direction on pre__header not its parent or don't even use flex imo If there is no reason to change the flex direction (i.e from row to col in a media query) its best to just use block/grid. sidenote: you could be using <nav> for your container inside header for proper semantics
jack_23011
jack_23011OP6d ago
by default flex is in the row
b1mind
b1mind6d ago
yes and by default block and grid items stack
jack_23011
jack_23011OP6d ago
and I have 2 containers as default names does that effect the code
b1mind
b1mind6d ago
lost me
b1mind
b1mind6d ago
this is your desired outcome yes?
No description
jack_23011
jack_23011OP6d ago
yes
b1mind
b1mind6d ago
then just change preheader to display: grid and don't even set flex on the parent `introarea` cause its doing nothing with a signle child atm
jack_23011
jack_23011OP6d ago
lovely
b1mind
b1mind6d ago
No description
b1mind
b1mind6d ago
and I meant this div can be <nav> well .. should be (for proper semantics, and a11y)
jack_23011
jack_23011OP6d ago
thanks a lot I changed it

Did you find this page helpful?