I have this form here for a credit card. I'm using Stripe's elements to create the card number input field. Just above the card number I have a name field, which vertically centers the name and placeholder, with a size, height, vertical alignment, etc.
QUESTION - What CSS properties can I use to set the Stripe card number, expiration and cvc field and placeholder field to be the same (vertical alignment) as the bootstrap input field? Specifically, how can I align the placeholder and text inside the element to a vertical center (like the bootstrap element)?
FYI - See how it's lower in the element than the bootstrap placeholder!
I can set CSS properties for the element like this below, but don't know which properties to use?
var style = {
base: {
// iconColor: '#666EE8',
// color: '#31325F',
// lineHeight: '40px',
// fontWeight: 300,
// fontFamily: 'Helvetica Neue',
// fontSize: '15px',
'::placeholder': {
// color: '#CFD7E0',
// fontSize: '1rem',
// fontWeight: '400',
// lineHeight: '1.5'
},
},
};
this.cardNumber = elements.create('cardNumber', {
style: style
});
this.cardNumber.mount(this.cardNumberElement.nativeElement);
<div class="mt-4" [formGroup]="paymentForm">
<div class="row">
<div class="form-group col-12">
<label class="control-label">Name on card</label>
<input placeholder="ex. John Smith" class="form-control" name="nameOnCard" formControlName="nameOnCard">
</div>
<div class="form-group col-6">
<label class="control-label">Card Number</label>
<div #cardNumber id="cardNumber" class="form-control py-3"></div>
</div>
<div class="form-group col-3">
<label class="control-label">Expiration</label>
<div #cardExpiry class="form-control py-3"></div>
</div>
<div class="form-group col-3">
<label class="control-label">Cvc</label>
<div #cardCvc class="form-control py-3"></div>
</div>
</div>
</div>
If I remove the py-3 from the element class then it looks like this where the placeholder is too high AND nothing gets typed into the element box when I give it focus and press a key. I'm getting the