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

117
Vistas
By hovering the element extends and cover another one

so I want to make it thats when you hover the input, the input extends to the full length of the div covering the whole span - i tried different option but they just dont work.

* {
  font-family: monospace;
  margin: 0;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.container {
  width: 330px;
  height: 30px;
  border: 1px solid black;
  display: flex;
  justify-content: center;
  align-items: center;
}

#input1 {
  margin-left: 15px;
  width: 70px;
  transition: .8s;
}

#input1:hover {
  width: 300px;
  margin: 0px 15px;
}
<div class="container">
  <span class="span1">what do you have to do?</span>
  <input id="input1" type="text" placeholder="">
</div>

i would be so gratefull if you just tried do help

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

If I understand your goal correctly, then you can solve this problem by using position: absolute; on the #input1.

* {
  font-family: monospace;
  margin: 0;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.container {
  width: 330px;
  height: 30px;
  border: 1px solid black;
  display: flex;
  justify-content: left;
  align-items: center;
}

#input1 {
  margin-left: 35%;
  width: 70px;
  transition: .8s;
  position: absolute;
}

#input1:hover {
  width: 300px;
  margin: 0px 15px;
}

.span1 {
  display: inline-block;
  float: left;
  margin-left: 20px;
}
<div class="container">
  <span class="span1">what do you have to do?</span>
  <input id="input1" type="text" placeholder="">
</div>

about 4 years ago · Juan Pablo Isaza Denunciar

0

You can try this:

.container {
  width: 330px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid black;
  display: flex;
  align-items: center;
}

#input1 {
  margin-left: 250px;
  width: 70px;
  transition: .8s;
  z-index: 10;
}

#input1:hover {
  width: 100%;
  margin: auto 0;
}

.span1 {
  position: absolute;
}
<div class="container">
  <span class="span1">what do you have to do?</span>
  <input class="input1" id="input1" type="text" placeholder="">
</div>

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