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

145
Visualizações
Font color won't change below a certain shade

I'm creating a web app using Angular 12. In my nav menu, I want text to be a dark gray (#161413). However, my text color won't take below a certain shade. For example, I can make my text "medium" red (#670000), but cannot make it "dark" red (#450000) - the text simply appears white below that #67xxxx threshold. I've commented out all css (including my styles.css parent) and left only my navmenu class. As a side note: there seems to remain some css influence on my text because the medium red appears lighter than it should be - like some opacity setting.

.navbar {
  color: black!important;
  justify-content: center;
  height: 20vh;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.7.5/angular.min.js"></script>
<div class="navbar">
  <div class="navmenu" *ngIf="atHome">
    <button class="nav-button" routerLink="/">HOME</button> |
    <button class="nav-button" (click)="LeaveHome()" routerLink="/link1">LINK1</button> |
    <button class="nav-button" (click)="LeaveHome()" routerLink="/link2">LINK2</button> |
    <button class="nav-button" (click)="LeaveHome()" routerLink="/link3">LINK3</button>
  </div>
  <div class="burger-shield" *ngIf="!atHome" (click)="ReturnHome()">
    <div class="burger-shield" routerLink="/">
    </div>
  </div>
</div>

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

0

looks like it works fine here. You are not giving us enough information. Show a complete snippet that showcases your problem

.navbar {
  color: red;
  justify-content: center;
  height: 20vh;
}

#a{
color:#450000;
background-color:white;
}

#b{
color:#670000;
background-color:white;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.7.5/angular.min.js"></script>
<div class="navbar">
  <div class="navmenu" *ngIf="atHome">
    <button id='a' class="nav-button" routerLink="/">HOME</button> |
    <button id ='b' class="nav-button" (click)="LeaveHome()" routerLink="/link1">LINK1</button> |
    <button class="nav-button" (click)="LeaveHome()" routerLink="/link2">LINK2</button> |
    <button class="nav-button" (click)="LeaveHome()" routerLink="/link3">LINK3</button>
  </div>
  <div class="burger-shield" *ngIf="!atHome" (click)="ReturnHome()">
    <div class="burger-shield" routerLink="/">
    </div>
  </div>
</div>

about 4 years ago · Juan Pablo Isaza Relatório

0

Thanks for everyone's contribution. This one really had me stumped all morning and your confusion (as well as mine) as to why this seemingly simple snippet of code wasn't working forced me to think outside the box. I recently downloaded a firefox plugin called "darkreader" that makes a dark mode for every website I visit. This plugin has a slider to make dark shades brighter until they hit the forementioned threshold - at which point they are lightened.

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