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

Align items in middle in CSS

I have a html code and i want to align theme like the image below:
aligned image

My html code:

<button class="container">
    <span class="btn__img"></span>
    <span class="btn__txt">Basic</span>
</button>

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

>Solution :

.container{
    display: flex;
    flex-direction: column;
    justify-content: center; // if you want to align it center vertically 
    align-items: center; // if you want to align it center horizontally
}

Apply this css to your button.

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