Grokking React Fundamentals
0% completed
Using Traditional CSS Styling
Where should the CSS for a React button live? React does not force one answer. You can keep the CSS in a separate file, as you would for a plain HTML page, or you can scope it to one component, or you can write it directly in the JSX. Each choice has a different cost, and this lesson styles the same "Click me" button all three ways so that you can compare them.
Using an External Stylesheet
The most familiar way to style a React component is a normal .css file. You write the CSS rules in the file, give the element a class name, and import the file into the component
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%