PGoCareerGoCareer prep tools
Home
LoginSign up
  • Java
  • Python
  • AI
  • React
  • Angular
  • PHP
  • Node.js
  • SQL
  • DSA
  • HTML
  • CSS
  • JS
  • Spring
  • ML
  • MongoDB

React · Theory

CSS in React

← All stacks

Theory

28/94

CSS in React

In React you still write CSS. Common ways: import './Card.css' + className, CSS modules (Card.module.css → styles.title), inline style objects, Tailwind utilities, CSS-in-JS. className, not class. One imported CSS file is global unless you use modules.

Pick one approach per project. Mixing Bootstrap grid + Tailwind + inline chaos is how UIs rot. Interview: name two methods and when you’d pick modules (avoid name clashes).

CSS in React — on screen — Hello inside .card styles. File import applies globally unless modules.

Exam tip

className + one styling approach.

Example

// CSS
import "./Card.css";

export default function Card() {
  return <article className="card">Hello</article>;
}

CSS in React — on screen: Hello inside .card styles. File import applies globally unless modules.

Short notes

  • RuleclassName.
  • Ways : file / modules / inline / Tailwind.
  • Trapglobal class name clashes.

Questions

1

Explain CSS as if you are teaching a junior — definition, then one tiny UI.

2

What does the example show on screen (or print), and what does that prove?

3

What mistake do freshers make with CSS?

Previous← React RouterNextAnimation in React →
P

GoCareerGo

Utilities · Preparation Hub · Resume · CV · Tools — one workspace.

Workspace

DashboardProfilePreparation HubResume builderCV builderCareer planning

PDF Tools

Merge PDFSplit PDFCompress PDFImage to PDFAll toolsJobs

Image & QR

Compress ImageResize ImageQR ScannerQR GeneratorBlogIT interview prep

Company

FAQFeedbackContactPrivacyTermsSitemap

© 2026 GoCareerGo. Keep moving forward.