My css style is not readable when it is deployed

I created a project for practice where it uses laravel 11 and tailwind css and preline js. I have a problem where my css style is not read when the website is deployed. how do I solve this?

No idea.
Provide more info.
What is your website?

2 Likes

To be able to help you with any issue:

  • Submit your support questions to the Hosting Support category, not the Informal category (where the topic template specifically says it’s not for support requests). I moved your topic, but please choose the appropriate category next time.
  • When you ask for help with a website, please always share the URL to that website so we can see the issue for ourselves.

As for this particular issue, could you please:

  • Share the URL to the CSS files that you use in your page but don’t work.
  • Share a screenshot of the file manager showing the list of files in the directory where the CSS files have been uploaded (where the CSS file should be visible, of course). Please make sure that the path you’ve taken a screenshot of is visible, but make sure to hide your browser’s address bar.
  • Share which method you used to setup Laravel on our hosting. Out of the box, Laravel says that the server should be configured to load files from the public folder, which is not possible on our hosting. There are a few different ways around this, and which approach you took affects where/how CSS files should be loaded.

We’re happy to help you with this, but we need a lot more information than “CSS does not load” to help you.

5 Likes

here’s my website http://musicstudios.lovestoblog.com/?i=1

If you want help, reply to all the questions Admin asked, not just the ones you want to answer.

And

6 Likes

that is my folder structure, let me know if you need more screenshots

Thanks for the additional information.

In the page source, I can see your page tries to load the stylesheets from https://musicstudios.lovestoblog.com/build/assets/app-Bd2nSrj2.css.

Can you please check the directory htdocs/build/assets/ and check that it contains the file app-Bd2nSrj2.css?

4 Likes


the file is inside my build/assets folder. btw i have recompiled the file so the filename changed

No, it isn’t. The file in there has a suffix that ends with AV3. The file used on your website has a suffix that ends with rj2. The file names are different. So the file that the website requests is not there.

Then you need to make sure that your website also uses that new file name. Because right now, it doesn’t.

I assume you’re using Laravel Vite? Then you must make sure that the build/manifest.json file matches the assets themselves.

3 Likes

thank you it’s working now. but i have a problem where the images for products, brands and categories can’t appear, even though on the local server it runs normally. i want to know where should i put the image folder/file, because the image file is in the ‘music-studios/public/strorage’ file.

and now the image on my homepage also does not appear. I don’t know why this is, even though I didn’t change anything

Your site is looking for images in this folder domain/sto/brands/

You actually have a URL encoded slash after dir brands (%2F) while before that they were normal, but as far as I can tell neither the folder brands nor its parent sto exists

4 Likes

The public/storage directory is intended for exposing files that were uploaded to your website, using the “Public Disk” file system: File Storage - Laravel 11.x - The PHP Framework For Web Artisans Although you should note that setting this up is not so simple because you cannot setup the symbolic links to make this work. I think it should be possible to emulate it with .htaccess rules, but I never tried to make that work.

Website images are typically part of the website code, and should not be placed there. But you’re basically free to put it anywhere else in the public folder, as long as you configure the right links on your website.

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.