[Answered ]-Bootstrap only works for the home page of my website, but no other html page. Why?

1👍

You have referred the stylesheet as follows in your template:

<link href="static/css/main.css" rel="stylesheet">

Here static/css/main.css is a relative url that starts from the current page not from the root. If the url is supposed to be from the root of the website relative urls should have a leading slash (/), hence you should have written:

<link href="/static/css/main.css" rel="stylesheet">

Better yet you should simply use the static template tag [Django docs]:

<link href="{% static 'css/main.css' %}" rel="stylesheet">

Leave a comment