I'm struggling to make basic CSS work in my Next.js 13 project. I'm a beginner, can someone please help?

I am facing issues with the default CSS in my latest project. I have a file called page.modules.css and I am using classname = styles.style

page.tsx

import styles from'./page.module.css'
export default function Home() {
  return (
    <div className={styles.testStyle}>
      Please send assistance
    </div>
  )
}


page.module.css

.testStyle {
    border-width: 2;
    border-color: #990099;
}

Answer №1

In order to fix your css class, it should be adjusted as follows:

.updatedStyle {
  border: solid #990099 2px;
}

Answer №2

Don't forget to add a semicolon after the closing parenthesis

import styles from './page.module.css';

export default function Home() {
  return (
    <div className={styles.testStyle}>
      send help
    </div>
  );
}

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

Issue with Firebase V9 addDoc: No indication of success or failure, and data is not being written to the

I am encountering an issue where the authentication related functions are working fine, but I am unable to make any progress with Firestore. Despite no errors or successes being returned by the try-catch block, nothing seems to happen in the Firestore data ...

What is the most effective way to perform unit testing on the "present" function of an Ionic alert controller?

I decided to write a unit test for the alert present function that gets triggered after creating an alert. This is what my code looks like. it('should call attempt To call alert present', async () => { const alert = { header: 'P ...

Does this fall under the category of accepted practices for employing an effect in Angular?

I am working on integrating an Angular directive with a signal that receives values from a store selector. This signal is crucial for determining whether a button should be disabled or not. I'm curious about the best approach to listen to this signal ...

Discovering the specific type of an object property in TypeScript

I am currently working on implementing a lookup type within an object. Imagine my object structure as follows: class PersonList { persons = { john: 'description of john', bob: 'description of bob' } } I want to create a ge ...

Errors in TypeScript are being brought up by using if-else statements inside a loop

I am currently working on a function to retrieve referral codes from users. The user inputs a code, which is then checked against the database to see if it exists or not If the code provided matches the current user's code, it should not be accept ...

Steps for creating a click event for text within an Ag-Grid cell

Is there a way to open a component when the user clicks on the text of a specific cell, like the Name column in this case? I've tried various Ag-Grid methods but couldn't find any that allow for a cell text click event. I know there is a method f ...

Decoding the build ID in NextJS: A step-by-step guide

When working with NextJS, there's the option to generate a build ID as mentioned in the documentation here: https://nextjs.org/docs/app/api-reference/next-config-js/generateBuildId Alternatively, it is also possible to retrieve the build ID based on ...

Is there a solution for the error message "Operator '+' cannot be used with types 'string | number' and 'string' | number'"?

Here's the scenario: I'm encountering an issue where I am invoking a function within another function. This inner function has the capability to return either a string or a number, and my goal is to combine that with another value. However, I kee ...

My requests and responses will undergo changes in naming conventions without my consent or awareness

Initially, I wrote it in a somewhat general manner. If you require more information, please let me know! This is how my C# class appears when sent/received on the frontend: public class Recipe : ICRUD { public Guid ID { get; set; } ...

pressing the button again will yield a new outcome

I am looking to disable a button (material ui) when it is clicked for the second time by setting disabled={true}. Unfortunately, I have not been able to find any examples related to this specific scenario on StackOverflow. <Button onClick={this.s ...

What causes useEffect to trigger twice when an extra condition is included?

Attempting to create a countdown timer, but encountering an interesting issue... This code triggers twice in a row, causing the useEffect function to run twice per second. 'use client' import {useState, useEffect, useRef} from 'react' ...

What is the method for creating a new array of objects in Typescript with no initial elements?

After retrieving a collection of data documents, I am iterating through them to form an object named 'Item'; each Item comprises keys for 'amount' and 'id'. My goal is to add each created Item object to an array called ' ...

How can I eliminate the excess padding caused by React Scroll Magic SectionWipes?

I am attempting to implement a scrolling component similar to the one found here: The code for this component can be found in the Github repository itself: https://github.com/bitworking/react-scrollmagic/blob/master/example/src/components/ScrollMagicExamp ...

Challenges with managing state in React and NextJS

I'm currently facing a challenge with my script in NextJS/React where I am finding it difficult to save state and reuse data in a variable. import React from 'react'; import Head from 'next/head' import Image from 'next/image& ...

replace the tsconfig.json file with the one provided in the package

While working on my React app and installing a third-party package using TypeScript, I encountered an error message that said: Class constructor Name cannot be invoked without 'new' I attempted to declare a variable with 'new', but tha ...

Alert: The text content did not align. Server indicated as "0" while client indicated as "1"

Using next js to develop the cart feature, I decided to store all cart items in localStorage. Below is how I implemented it: import React, { createContext, useContext, useState, useEffect } from 'react'; import { toast } from 'react-hot-toas ...

Issue: Trying to render objects as React children is invalid (object found with keys {_id}). If you intended to display multiple children, use an array instead

My intention in the NextJS application is to retrieve JSON data from my MongoDB database using getInitialProps as shown below: static async getInitialProps(ctx) { const res = await fetch('http://localhost:3000/api/endpoint'); const j ...

What is the reason for not being able to call abstract protected methods from child classes?

Here is a simplified version of my project requirements: abstract class Parent { protected abstract method(): any; } class Child extends Parent { protected method(): any {} protected other() { let a: Parent = new Child() a.me ...

What is the best way to utilize Typescript when making queries to Firebase?

I have successfully integrated push notifications for my app using Firebase Cloud Functions. Now, I am looking to enhance the user experience by updating the app's badge count alongside the push notifications. I understand that this can only be achiev ...

Steps for hosting a NEXTJS app on Google Cloud Platform with a dynamic [id].js page:

My application is hosted on Google and I recently ran into an issue while trying to implement dynamic routes. Previously, I would host it by executing next export followed by firebase deploy. However, while working in my [id].js file where I fetch data us ...