Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

165
Views
Why do not add css style in my react project?

I do make a style in my react project. Like as

style.css:

.headingStyle {
  background-color: purple;
  text-align: center;

}

and my react component is:

import React from 'react'
import  '../cse_component/style.css'


export default function heardTitle() {
    return (
        <div>
            <h1 ClassName='headingStyle'>Todo List</h1>
        </div>
    )
}

But why I can not change anything in my project?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

I think you misstype the className prop. It should be className not ClassName using capital C.

Try changing it from this

<h1 ClassName='headingStyle'>Todo List</h1>

into this:

<h1 className='headingStyle'>Todo List</h1>
about 4 years ago · Juan Pablo Isaza Report

0

I guess there is a typo error on ClassName use className.

import React from 'react'
import  '../cse_component/style.css'


export default function heardTitle() {
    return (
        <div>
            <h1 className='headingStyle'>Todo List</h1>
        </div>
    )
}

For inline css use the code as <h1 style={{ background-color: purple;text-align: center; }} >Todo List</h1>

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!