Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

312
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda