Question · JavaScript and React course · Module 7: Styling and Animations
className vs inline styles
What is the main difference between className and style in React?
Answer options
- className uses JavaScript objects, style uses strings
- style only works with CSS Modules
- There is no difference, they are synonyms
- className refers to CSS classes, style is for inline style objects
You can check the correct answer by solving this task in the CodeWorlds game.