Sai Krishnadas
Sai Krishnadas

Reputation: 3409

couldn't style react components with external css

My react file isn't picking up my external styles.css

index.js :

import React from "react";
import ReactDOM from "react-dom";
import "./css/styles.css";

ReactDOM.render(
  <div>
    <h1 className="upper-deck"> Hello world </h1>
  </div>,
  document.getElementById("root")
);

styles.css:

.App {
  font-family: sans-serif;
  text-align: center;
}

.upper-deck {
  font-size: "90px";
}

Project folder format :

folder format

Upvotes: 2

Views: 34

Answers (1)

Drew Reese
Drew Reese

Reputation: 202618

Don't use quotes for scaler values in CSS. Remove the quotes around the pixel value for the font size.

.upper-deck {
  font-size: 90px;
}

Upvotes: 1

Related Questions