Styling a React Application
Learn how to style React components using CSS.
We'll cover the following...
Importing a CSS file
React components can be styled by creating a CSS file and importing it into our component. Take a look at the code below:
import React from "react";
const Info = () => {
return (
<div>
<h1>Educative is awesome</h1>
</div>
);
}
export default InfoReact component
The widget above consists of two React components named App and Info. The App component is the parent component that’s rendered by ReactDOM. Take a look at the index.js file, and notice that a style.css file is required and imported for use in the React app. This stylesheet is global to our React app because it ...
Ask