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

267
Vistas
CSS not being applied to component in React

I have a CSS file which I have imported in the index.js file and the App.js as well, but still the CSS is not being applied to to the component

App.js:

import "./App.css";
function App() {
  return (
    <div classname="wrapper">
      <h1>BookList App</h1>
      <p>Add or remove books</p>
      <div classname="main">
        <div classname="form-container"></div>
        <div classname="view-container"></div>
      </div>
    </div>
  );
}

export default App;

index.js:

import React from "react";
import ReactDOM from "react-dom";
import "./App.css";
import App from "./App";
import reportWebVitals from "./reportWebVitals";
import "bootstrap/dist/css/bootstrap.css";

ReactDOM.render(
  <React.StrictMode>
    <App />
  </React.StrictMode>,
  document.getElementById("root")
);

/
reportWebVitals();

File structure:

src:
|App.css
|App.js
|index.js

I am not able to understand why the CSS is not being applied even though I have imported it

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You need to replace classname with className ( N capital in className). It should fix your issue.

Try the code given below:

import "./App.css";
function App() {
  return (
    <div className="wrapper">
      <h1>BookList App</h1>
      <p>Add or remove books</p>
      <div className="main">
        <div className="form-container"></div>
        <div className="view-container"></div>
      </div>
    </div>
  );
}

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