Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

HTML element position won't change

I’m working on a "easy" dashboard layout to get in touch with Css better. Now I have the problem my links are next to each othe instead of underneath.
`

<div class="column is-one-fourth menu">
                <a href="dashboard.html" class="fxlarge">Dashboard</a>
                <a href="dashboard.html" class="fxlarge">Account</a>
                <a href="dashboard.html" class="fxlarge">Help</a>
                <a href="dashboard.html" class="fxlarge fred">Logout</a>
</div>

My CSS:

.menu{
    display: flex;
    justify-content: center;
    align-items: center;
}

I’m looking forward for your help,
thanks.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I treied to play around with justify-content and align items but nothing helped.

>Solution :

just set the menu to be flex-direction to column and anchor’s to be block type, this should fix your issue.

.menu{
    display: flex;
    justify-content: center;
    align-items: center;  
    flex-direction: column;
}
.menu > a {
    display: block;
}
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading