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

157
Vistas
i want to place the text near the image inside the round box

Its looking like this

I want the icon to be near the text inside the round box but its appearing down, here's my code.

HTML:

    <div className="RoundBox">
                               
        <div className="DashImages"><img src={PDF} alt="PDF"></img>
        <div className="IconText">PDF File</div>
                              
    </div>

CSS:

 img {
  width: 3vw;
  height: 3vw;
  margin-left: 1vw;
}

.IconText {
}

    .RoundBox {
  border-radius: 0.5vw;
  border: 1.5px solid grey;
  box-shadow: #e3eaf6;
  width: 20vw;
  height: 3vw;
  float: left;
}
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

This should do the trick.

Div elements are block items so they will always try to fill the whole horizontal space if the display or width properties are not changed or the parent item overrides that behavior (eg. using FlexBox)

HTML

<div className="RoundBox">
                           
    <div className="DashImages"><img src={PDF} alt="PDF" /></div>
    <div className="IconText">PDF File</div>
                          
</div>

CSS

img {
  width: 3vw;
  height: 3vw;
  margin-left: 1vw;
}

.IconText {
padding-left: 10px
}

.RoundBox {
  border-radius: 0.5vw;
  border: 1.5px solid grey;
  box-shadow: #e3eaf6;
  width: 20vw;
  height: 3vw;
  float: left;
  display: flex;
  align-items: center;
}
about 4 years ago · Juan Pablo Isaza Denunciar

0

Your html is invalid with the image tag and you're missing a div. You would want to fix that first.

<div className="DashImages"><img src={PDF} alt="PDF" /></div>

You then have a couple options. Here are a two examples:

  1. You can simply add float: left to the img css. I might recommend using a class rather than a selector which targets all img tags. Example
img {
  width: 3vw;
  height: 3vw;
  margin-left: 1vw;
  float: left;
}
  1. You can also explore using flexbox adding display: flex; to your .RoundBox class. Note there are different alignment attributes that you can use to position elements using flex.

.RoundBox {
  border-radius: 0.5vw;
  border: 1.5px solid grey;
  box-shadow: #e3eaf6;
  width: 20vw;
  height: 3vw;
  float: left;
  display: flex;
}
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