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

In small screen wrap from left css

I have two buttons like [button_2] [button_1] in my screen after I make the screen smaller they place in a column like below

[button_2]
[button_1]

but I want the opposite in small screen I want it to wrap from left and have it like below .

[button_1]
[button_2]

and the code is :

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

 @media only screen and (max-width: 600px) {
 .buttonGroup {
    display: flex;
    flex-wrap: wrap;
    min-width: 100%;

    .selectProductListButton {
      text-align: center;
      flex: 50%;
      margin-bottom: 10px;
    }
  }
}

>Solution :

.buttonGroup {
  flex-direction: column;
  display: flex;
  flex-wrap: wrap;
  min-width: 100%;
}

@media only screen and (max-width: 600px) {
  .buttonGroup {
    flex-direction: column-reverse;
  }
  .selectProductListButton {
    text-align: center;
    flex: 50%;
    margin-bottom: 10px;
  }
}
<div class='buttonGroup'>
  <button type='button' class='selectProductListButton'>Button 1
</button>
  <button type='button' class='selectProductListButton'>Button 2
</button>
</div>
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