Solution 1 :

You can add them for the same div with ‘Add credit card’. I’m sorry, your question is not clear. I can’t understand correctly. And where is accordion? (from Abhishek Pandey)

<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<div class="screenPayment">
  <div class="payment">
    <div class="payment-tab">
      <div class="payment-radioGroup">
        <input id="paypal" name="cardType" type="radio" value="paypal">
        <label for="paypal">PayPal</label>
      </div>
      <p>You will be redirected to PayPal to complete your purchase securely.</p>
    </div>
    <div class="payment-tab payment-tab-isActive">
      <div class="payment-radioGroup">
            <input checked="" type="radio" name="cardType" id="creditCart" value="creditCard">
          <label for="creditCart">Add credit card</label>
<img class="payment-cardimg" src="https://www.f-cdn.com/assets/main/en/assets/payments/cc/visa.svg">
          <img class="payment-cardimg" src="https://www.f-cdn.com/assets/main/en/assets/payments/cc/mastercard.svg">
          <img class="payment-cardimg" src="https://www.f-cdn.com/assets/main/en/assets/payments/cc/amex.svg">
      </div>
      <div class="textInputGroup">
        <label for="nameOnCard">Name on card</label>
        <input id="nameOnCard" name="nameOnCard" required="" type="text">
      </div>
      <div class="textInputGroup">
        <label for="cardNumber">Card number</label>
        <input id="cardNumber" name="cardNumber" placeholder="1234 - 5678 - 9876 - 5432" required="" type="text">
      </div>
      <div class="textInputGroup textInputGroup-halfWidth">
        <label for="expirationDate">Expiration Date</label>
        <input id="expirationDate" name="expirationDate" placeholder="MM / YY" required="" type="text">
      </div>
      <div class="textInputGroup textInputGroup-halfWidthRight">
        <label for="cvc">CVC</label>
        <input id="cvc" name="cvc" placeholder="XXX" required="" type="text">
      </div>
    </div>
  </div>
</div>

Test the following second the snippet

<script async src="//jsfiddle.net/g9byLcew/embed/"></script>

I added a div for the credit card. This div has a position absolute, right:0, top:16px. I removed credit cards CSS like position, right, top. Could you test again the last snippet?

Problem :

I am trying to add a card logo group next to my accordion view. I want to add a group card visa, MasterCard, and AMEX using SVG, but I tried to add 3 images in a row, but I don’t think it is the best approach to do this.

<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<div class="screenPayment">
  <div class="payment">
    <div class="payment-tab">
      <div class="payment-radioGroup">
        <input id="paypal" name="cardType" type="radio" value="paypal">
        <label for="paypal">PayPal</label>
      </div>
      <p>You will be redirected to PayPal to complete your purchase securely.</p>
    </div>
    <div class="payment-tab payment-tab-isActive">
      <div class="payment-radioGroup">
        <input checked="" type="radio" name="cardType" id="creditCart" value="creditCard">
        <label for="creditCart">Add credit card</label>
      </div>
      <img class="payment-cardimg" src="https://www.f-cdn.com/assets/main/en/assets/payments/cc/visa.svg">
      <img class="payment-cardimg" src="https://www.f-cdn.com/assets/main/en/assets/payments/cc/mastercard.svg">
      <img class="payment-cardimg" src="https://www.f-cdn.com/assets/main/en/assets/payments/cc/amex.svg">
      <div class="textInputGroup">
        <label for="nameOnCard">Name on card</label>
        <input id="nameOnCard" name="nameOnCard" required="" type="text">
      </div>
      <div class="textInputGroup">
        <label for="cardNumber">Card number</label>
        <input id="cardNumber" name="cardNumber" placeholder="1234 - 5678 - 9876 - 5432" required="" type="text">
      </div>
      <div class="textInputGroup textInputGroup-halfWidth">
        <label for="expirationDate">Expiration Date</label>
        <input id="expirationDate" name="expirationDate" placeholder="MM / YY" required="" type="text">
      </div>
      <div class="textInputGroup textInputGroup-halfWidthRight">
        <label for="cvc">CVC</label>
        <input id="cvc" name="cvc" placeholder="XXX" required="" type="text">
      </div>
    </div>
  </div>
</div>

I am expecting to add this kind of card group into my accordion cardgroup

Comments

Comment posted by ht13

I run your code. But I don’t see 3 cards? Where are them?

Comment posted by Aron Imperial

I update the code

Comment posted by Abhishek Pandey

Where is accordion?

Comment posted by jsfiddle.net/y0gLqonp/2

jsfiddle.net/y0gLqonp/2

Comment posted by jsfiddle.net/y0gLqonp/2

I am trying to place those 3 icons where amex takes place as a single card

Comment posted by ht13

I added the second snippet and explanation.

By