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

91
Vistas
Displaying HTML elements in same row

I am looking to achieve options as
enter image description here


But with current code, am getting it as below:

enter image description here

How to get options Yes and No next to each other

Below is my code: For HTML

<div class="mycustom-radios">            
            <div class="mycustom-radios__item" *ngFor="let employeeType of employeeTypes">
                <input class="mycustom-radios__input" id="e_employeetype" name="what-type-of-employee" type="radio" [value]="employeeType" [(ngModel)]="selectedemployeeType"/>
                <label class="mycustom-label mycustom-radios__label" for="e_employeeType">
                <p>{{employeeType}}</p>
                </label>
            </div>      
        </div>

For component.ts

selectedemployeeType: string;
employeeTypes: string[] = ['Yes', 'No'];
over 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

@Patty! Try using the display:flex CSS property, like this:

<div style="display:flex">
<div>div block 1</div>
<div>div block 2</div>
</div>

over 4 years ago · Santiago Trujillo Denunciar

0

You need to apply the CSS styles like so.

// use this styling
div{
  display:flex;
  align-items:center;
}    
input{
  margin-right:5px;
}
input:last-child{
  margin-right:0px;
}
<div>
     <!-- nest your angular controls here -->
     <input type="checkbox" />
     <input type="checkbox" />
     <input type="checkbox" />
     <input type="checkbox" />
     <input type="checkbox" />
</div>

over 4 years ago · Santiago Trujillo Denunciar

0

Change p to span and apply display:inline as in below example. In the example I have added 2 divs to mimic *ngFor="let employeeType of employeeTypes"

.mycustom-radios__item {
  display: inline-flex;
}
<div class="mycustom-radios">
  <div class="mycustom-radios__item" *ngFor="let employeeType of employeeTypes">
    <input class="mycustom-radios__input" id="e_employeetype" name="what-type-of-employee" type="radio" [value]="employeeType" [(ngModel)]="selectedemployeeType" />
    <label class="mycustom-label mycustom-radios__label" for="e_employeeType">
                <span>No</span>
                </label>
  </div>
  <div class="mycustom-radios__item" *ngFor="let employeeType of employeeTypes">
    <input class="mycustom-radios__input" id="e_employeetype" name="what-type-of-employee" type="radio" [value]="employeeType" [(ngModel)]="selectedemployeeType" />
    <label class="mycustom-label mycustom-radios__label" for="e_employeeType">
                <span>Yes</span>
                </label>
  </div>
</div>

over 4 years ago · Santiago Trujillo 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