failed to apply external CSS to style React components

I am experiencing an issue where my React file is not recognizing 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 structure :

https://i.sstatic.net/q3NxD.png

Answer №1

It is recommended to avoid using quotes for scalar values in CSS. Please update the code by removing the quotes around the pixel value specified for the font size.

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

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Having trouble retrieving react environment variables from process.env?

When developing my React App, I utilized a .env file to securely store some essential API keys. However, as I attempted to access these variables using process.env, I encountered an issue where the values appeared to be set as undefined. To launch the app ...

Swapping out data within a container

I've been experimenting with creating a hangman game using JavaScript and HTML. However, I'm facing an issue where clicking on a letter doesn't replace the "_" placeholder. var myList=["Computer","Algorithm","Software","Programming","Develop ...

Control the switch for CSS selectors

Consider the following scenario where CSS rules are defined: <style> table {background:red;} div {background:green;} </style> In addition, there is HTML code that calls a JavaScript function: <table onclick="tu ...

Showing how an iframe can adjust its height to 100% within a div element

Currently, I have a player status script implemented on our Minecraft Server. This script displays the server name, IP address, and the heads of the players currently online. The setup includes two div boxes for the status box: one outer box to fix its pos ...

What is the best way to trigger a useReducer dispatch function from a different file that is not a React component, without relying on Redux?

In my project, I have a function component that shows a game board named "EnemyBoardComponent.tsx" const enemyBoardReducer = (state:number[][], action:Action)=>{ switch(action.type){ case "update": { return EnemyBoard.getGrid(); ...

traverse a deeply nested object within an array

Currently facing an issue with mapping over an array containing multiple nested objects. The map function seems to only return the outer object when executed. https://i.stack.imgur.com/7JNsN.png const [moreDetails, setMoreDetails] = useState([]); const [d ...

Is there a way to expand my dialog box to fill the entire screen?

Currently, I am studying a tutorial on creating an angular lightbox, which can be found here. However, I am facing an issue where the lightbox only expands to the size of the div when I place the button inside it. The code snippet in question is as follows ...

Saving table sorting in Redux with Ant Design Table

I am currently working with Antd Version 4.2.2 in my ReactJS project. Specifically, I am utilizing the Ant Design < Table /> component. My goal is to save the sorting order that is applied to the columns into Redux state. Here is my current approa ...

How can I display a customized component on a table based on the data object's value?

I am working on a custom Table component that I want to render based on an array of objects. The challenge is that I need the Table component to have two props: one for the data object and another for an array of objects, each containing a title and a func ...

Having difficulty getting my ASP telerik menu to function properly

After researching numerous threads on how to apply a personalized design to a telerik menu on my website, I have reached out for assistance. Even though some may not be familiar with the specifics, I am in urgent need of help with my current coding. In my ...

Incorporate an icon into a text input field using Material UI and React

I have a form with a text input element: <FormControl className='searchOrder'> <input className='form-control' type='text' placeholder='Search order' aria-label='Search&ap ...

Is there a way to implement a collapse/expand feature for specific tags in React-Select similar to the "limitTags" prop in Material UI Autocomplete?

Utilizing the Select function within react-select allows me to select multiple values effortlessly. isMulti options={colourOptions} /> I am searching for a way to implement a collapse/expand feature for selected tags, similar to the props fun ...

Substituting a div component in React

import Y2013 from "./components/Y2013"; import Y2012 from "./components/Y2012"; import Y2011 from "./components/Y2011"; import Y2010 from "./components/Y2010"; function App(){ return( <div className="A ...

Is there a way to compel @keyframes to continue playing until it reaches its conclusion even after a mouseout event

Whenever I hover over an element, a keyframe animation starts playing. However, when I move the cursor away, the animation stops abruptly. Is there a way to ensure that it plays until the end? I've tried using the animationend event, but it doesn&apos ...

I'm having trouble with aligning my input checkbox within the form

My form includes multiple checkboxes, but I am having trouble aligning them properly. <!-- Multiple Checkboxes (inline) --> <div class="form-row"> <label class="chkdonar" for="donarchkform-0">Yes, I want to donate to AMIAB</label> ...

struggling to get the basic .gif loader to function properly

I recently designed a website with multiple images on certain pages, and I wanted to incorporate a loading gif that shows up in a specific div (#carousel) while the images load. I found a super simple guide on a website that I attempted to follow, but unfo ...

Detecting the directional scrolling on a page with the rubber band effect disabled

html { height: 100%; width: 100%; overflow: hidden; } body{ margin: 0; min-width: 980px; padding: 0; height: 100%; width: 100%; overflow: auto; } In order to prevent macOS rubber band scrolling and detect the scroll directi ...

Ways to create a horizontal navigation menu using jQuery UI

Hey there, I'm really enjoying all the jQuery UI features! I have a question about the navigation menu - for some reason, I can't seem to get it to display horizontally. I've been playing around with the CSS but I must be missing something ...

Is there a problem with the way divs are being displayed when using jQuery to show the first 12 elements with the class "hide-show"?

I am encountering a problem with displaying data using the jQuery slice() and show() methods to reveal dynamically generated divs from a PHP function. The code is as follows: <style> .hide-show { display :none; } </style> <div class="c ...

How to effectively manage concurrent action calls in React Flux and prevent the "dispatch in the middle of a dispatch" issue?

My controller view, named , is responsible for fetching initial data from two API endpoints. The first endpoint deals with User authentication state, while the second provides a list of items used to populate a menu. Controller View: import React, { Prop ...