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

How to swap element position using Css?

I want to change the position of two elements using CSS.

The structure of my website is as follows and it show up del ins.

<span class="main-price">
  <del aria-hidden="true">
   <span class="price">
  </del>
  <ins>
   <span class="price">
  </ins>
</span>

No CSS is applied to these elements.

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

So I applied CSS like below.

.main-price{
       text-align: left;
       display: inline-flex;
       flex-direction: column-reverse;
}

However, this will place the two elements vertically as shown below.

ins
del

So I re-applied the below css, still no change.

.ins{
display:inline;
}

I’ve tried many times other than that, but no matter what I do, it doesn’t show up as ins del.

Can someone give me some advice on what to do?

>Solution :

Instead of flex-direction: column-reverse, use flex-direction: row-reverse.

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