Home > Software design >  How to swap element position using Css?
How to swap element position using Css?

Time:03-29

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 >
  <del aria-hidden="true">
   <span >
  </del>
  <ins>
   <span >
  </ins>
</span>

No CSS is applied to these elements.

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?

CodePudding user response:

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

  • Related