Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

96
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda