Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

309
Views
InitTelInput — how to set correct padding left in input?

I use InitTelInput in my project.

If i init this lib all work good.

enter image description here

<input type="tel" class="form__tel-input" id="phone" placeholder="">

.form__tel-input {
    position: relative;
    width: 100%;
    padding: 24.5px 24px 25.5px 126px;
    font-family: Lato;
    font-style: normal;
    font-weight: normal;
    font-size: 18px;
    line-height: 170%;
    background: #EEEEEE;
    border-radius: 10px;
}

$(() => {
    $('#phone').intlTelInput({
        hiddenInput: 'full_number',
        initialCountry: 'auto',
        geoIpLookup: function (callback) {
            $.get('https://api.sypexgeo.net/json/', function (location) {
                let countryCode = location.country.iso;
                callback(countryCode);
            })
        },
        separateDialCode: true,
    });
})

https://codepen.io/ivstepin/pen/JjJbRrd?editors=1111

But if i add padding for .iti__flag-container then country selector overlaps input.

enter image description here

.iti__flag-container {
  padding: 16px;
}

https://codepen.io/ivstepin/pen/NWgbRLB?editors=1111

How to make correct padding for input?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Use this css to correctly style the input

.iti__flag-container {
    margin: 16px;
    position: relative;
}

.iti {
    display: flex;
    justify-content: center;
    flex-direction: row;
    border: 2px solid;
    border-radius: 10px;
    background: #EEEEEE;
}

.form__tel-input {
    position: relative;
    width: 100%;
    padding: 24.5px 24px 25.5px 166px;
    font-family: Lato;
    font-style: normal;
    font-weight: normal;
    font-size: 18px;
    line-height: 170%;
    background: #EEEEEE;
    border-radius: 10px;
    padding-left: 0px !important;
    border: 0px !important;
    outline: none;
}

You can checkout this in action here in codepane

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!