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

302
Visualizações
class is not shown in elements inspector in chrome

as shown in the image and in the circled parts, i created a class called clsTest. in this class i would like to change the position and some propertities of the circled element in red as shown in the image. the circled elements in red are composed of input field and icon of the calendar. when i activate the elements inspector in chrome, the class clsTest is never present or listed among other classes. in other words ,as shown in the image, the class .clr-control-container is shown but the class clsTestis not!!

please let me know how to correctly assign a class and be able to modify its attributes to change the position and properties of the circled element in red.

html:

<clr-date-container class="clsDateContainer">
            <label id="idDateOfSprayLabel">
                <p>Date:</p>
            </label>
            <input id="idDateOfSprayValue" class="clsTest clr-control-container" clrDate type="date" placeholder="Specify date of spray" [(ngModel)]="iDatePasser.dateOfSpray" (ngModelChange)="onDateOfSpraySet($event)" name="dateOfSpray"
                value="2021-07-21" min="2021-01-01" max="2090-12-31" />
        </clr-date-container>

css:

.clsTest{
bottom: 10;
right: 0px;
left: 430px;
top: 174px;
width: auto;

}

image:

enter image description here

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

I assume the default Angular style encapsulation is causing this behavior here.

Try adding the pseudo class :host to your css like this:

:host .clsTest{
  bottom: 10;
  right: 0px;
  left: 430px;
  top: 174px;
  width: auto;
}

The :host tells Angular to apply the styles directly on DOM elements (not based on components/templates). Optionally, you could also add ::ng-deep to apply styles to all children of the selected element as well (where the CSS selector matches as well).

about 4 years ago · Juan Pablo Isaza Relatório

0

The input has the class at the moment

To see the classes of the input element just click on it(in the Element section of chrome developer tools), I specify it on the image.

Keep in mind the sequence of the classes you give to an element is important. The second class will override the first one.

Image was updated

about 4 years ago · Juan Pablo Isaza 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