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

936
Visualizações
How to change the default screen background color of all the pages in React JS(Next JS) using tailwind CSS

I am trying to change the default screen background colour of all the pages of the web application.

Technologies I used:

  1. React JS
  2. Next JS
  3. Tailwind CSS

I want to make the screen background colour of all pages light grey as shown in the image instead of the default white colour.

enter image description here

Is there any way to do that all at once, or do we need to add background colour manually to every page?

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

0

If you are using NextJS you can make use of a custom file _app.jsx (if you are using javascript) or _app.tsx (if you are using TypeScript) to change the background colour (and many more by the way) of all your web pages.

You can create a div in the file and add background colour to the className, it will be applied to all pages being rendered in the web application.

Code example :

function MyApp({ Component, pageProps }) {
 return (
  <div className="bg-gray-500">
    <Component {...pageProps}/>
  </div>
 );
}

NextJS has a more detailed explanation about this.

about 4 years ago · Juan Pablo Isaza Relatório

0

You can go to styles -> globals.css and there add the following

html {
  width: 100%;
  height: 100%;
  background-color: {color of your choice};
}

By this; all your pages will have the specified background color unless you specify a separate background color for any component.

about 4 years ago · Juan Pablo Isaza Relatório

0

Adding bg-color to a div only adds color to a div... I think the html { background-color: {color of your choice}; is more likely to yield the desired result. Having same issue. Applied your solution but it only filled the div that fell short of page view. Of course the previous comment's coding is incorrect. should be:

html {
    background-color: #yourcolor
}
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