skip to Main Content

Hello everyone i am building a website using nextjs and converted the html elements of a page to jsx elements but the css of template is not implementing. I have added correct paths and also updated globals.css media query but still no css is working.I could provide more details if required for this problem.

<link rel="shortcut icon" href="img/logos/Anakage black Logo.png" />
  {/* plugins */}
  <link rel="stylesheet" href="/css/plugins" />
  {/* search css */}
  <link rel="stylesheet" href="/search/search.css" />
  {/* quform css */}
  <link rel="stylesheet" href="/quform/css/base.css" />
  {/* theme core css */}
  <link href="/css/styles.css" rel="stylesheet" />
  {/* custom css */}
  <link href="/css/custom.css" rel="stylesheet" />

I have template downloaded and wanted to implement in nextJS but the resultant file is not having any css or javascript.

2

Answers


  1. Based on the documentation on NextJS, another option is you can use the ‘import’ to add your stylesheet file to your app. This will apply to all of your app when you import on the top level. Here the link:
    NextJS Global Style

    Apparently, you also use the CSS module to make your code more organized and avoid naming collisions.

    Another tips for you is to check network tab on dev tools whether the file is not being imported / cached with the previous file.

    Hope this will help you!

    Login or Signup to reply.
  2. Check the below

    1. Make sure you are placed the css files under ‘public’ folder
    2. Check the CSS file, Syntax errors or unsupported CSS features can cause the browser to ignore the stylesheet.
    3. Clear the browser cache
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search