#CSS not loading when deploying

6 messages · Page 1 of 1 (latest)

leaden portal
#

Hello I am deploying my site to Netlify and I followed the direction for the adapter. When the site is deployed none of the CSS is loaded. Here's how my <head> looks :

  <link href='/css/custom.min.css' rel='stylesheet' />

  <!-- Custom Styles -->
  <link href='/css/style.css' rel='stylesheet' />

  <!-- Favicon -->
  <link href='img/favicon.ico' rel='icon' />

  <!-- Google Web Fonts -->
  <link rel='preconnect' href='https://fonts.gstatic.com' />
  <link
    href='https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@400;700&family=Roboto:wght@400;700&display=swap'
    rel='stylesheet'
  />

  <!-- Icon Font Stylesheet -->
  <link
    href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.0/css/all.min.css'
    rel='stylesheet'
  />
  <link
    href='https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css'
    rel='stylesheet'
  />

  <script>
    // Astro will bundle and process this automatically
    import 'bootstrap/dist/js/bootstrap.bundle.min.js';
  </script>```
keen marten
#

Where is your CSS?
I believe it should be in /public/css/custom.min.css for

<link href='/css/custom.min.css' rel='stylesheet' />

to work

leaden portal
keen marten
#

If you start a path with / then that's /public

leaden portal
# keen marten If you start a path with `/` then that's `/public`

It fixed no images loading but the styles still arent loading getting this in console
Refused to apply style from 'https://famous-rolypoly464901.netlify.app/public/css/custom.min.css' because its MIME type ('') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

keen marten
#
<link href='/css/custom.min.css' rel='stylesheet' type="text/css" />