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

225
Vistas
How to place the input element in the middle of the two columns

 IMAGE OF THE WEB PAGE I WANT TO CREATE, I CREATED THAT IMAGE IN PAINT!

I want to create a web page which takes a number as input then Even or ODD background color changes depending upon the number for eg if I enter 2 then Odd background color becomes gray and even background color becomes Green, I hope u understand what I want to do, the thing is I want to place the input field in the middle like in the picture, Can anyone help me how to do that? it would be very helpful for future purposes also, Thank you!!!!

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

0

To place the input in the middle of boxes, , you can use from position absolute, and depending on the size of the boxes, you should set 'left' & 'top' styles for input, e.g in my example:

<body>
    <div class="box box1">EVEN</div>
    <div class="box box2">ODD</div>
    <input type="text" name="input" />
</body>

CSS:

    *{
        box-sizing: border-box;
    }
    .box{
        float: left;
        padding: 200px;
        width: 50%;
    }
    .box1{
        background-color: green;
    }
    .box2{
        background-color: red;
    }
    input{
        position: absolute;
        left: 45%;
        top: 200px;
        padding: 5px;
        border-radius: 10px;
    }

enter image description here

about 4 years ago · Juan Pablo Isaza Denunciar

0

I added a solution below. You also had an extra closing div tag without it having a opened one, I removed that for you too.

body {
  font-family: Arial;
  color: white;
}

.split {
  height: 100%;
  width: 50%;
  position: fixed;
  z-index: 1;
  top: 0;
  overflow-x: hidden;
  padding-top: 20px;
}

.top {
  z-index: 2;
  width: 100%;
  left: 0;
  right: 0;
}

.left {
  z-index: 1;
  left: 0;
  background-color: #111;
}

.right {
  right: 0;
  background-color: red;
}

.centered {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.centered img {
  width: 150px;
  border-radius: 50%;
}

form {
  height: 100%;
}

.form-group {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  height: 100%;
}

    <div class="split top">
        <form method ="POST">
            <div class="form-group">
                <label for="Id_messsage">Message</label>
                <textarea class="form-control" id=Id_message" name="message" rows="5"></textarea>
            </div>
        </form>
    </div>
    <div class="split left">
        <div class="centered">
            <h2>EVEN</h2>
        </div>
    </div>

    <div class="split right">
        <div class="centered">
        <h2>ODD</h2>
        </div>
    </div>
    
about 4 years ago · Juan Pablo Isaza Denunciar

0

Set in the container of the input display flex and then it will be in the middle of the page, like that:

 display:flex; justify-content:Center; align-items:center;
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