Forums

Bootstrap/CSS not loading properly

Please bear with me as I am new to web development as well as django. I created a web app for my college project and its functioning perfectly fine. The only problem is that I guess the bootstrap/css is not loading properly cause the app looks quite different than it looks on my localhost. I already configured static files according to the instructions here. Also if I look at the source code of my web app, the stylesheet points to the correct css file. Any help will be appreciated.

It looks like the CSS is loading correctly at the moment -- did you work out what the problem is?

Well, the way it looks right now is still not quite "correct". Maybe it is because of some problems or the way I wrote my HTML files. I will try to work it out in a couple of days. Thanks for your reply, though.

One thing to check while you're working on it is the browser's developer console:

  • Go to your page
  • Bring up the developer tools (in Chrome, go to the "Hamburger" menu, then "More tools", then "Developer tools")
  • Click on the "Network" tab
  • Reload your page.

Then, if there are any problems with loading CSS or JavaScript resources, you'll see the exact errors. Right now, there are no errors being shown, which means that everything is being loaded correctly (even if the way it's being used means that it's not displaying the way you want it to be displayed). But it's a useful tool to have open while you're working on it, so that you can get an early warning of any problems with CSS loading.

Thanks for that advice. Will always keep that in mind from now on. I rewrote all of the html and css files and there doesn't seem to be any problem now. Thanks again for your help.

:)