On certain pages, I have included Bootstrap.
On one particular page, I have an alert styled with Bootstrap.
This is how it's defined:
$('#wrongPasswordDiv').html('<br/><div class="alert alert-danger" id="wrongPWAlert" role="alert">Incorrect password. Please try again!</div>');
Prior to that, the Bootstrap CSS file is included:
<link rel="stylesheet" type="text/css" href="/bootstrapcss" />
bootstrapcss
is linked to the correct CSS file.
In the network tab, it is evident that Bootstrap is loading correctly:
https://i.sstatic.net/n9B7a.png
However, even though it is loading, the classes are not being applied.
When I switch to using a CDN to include Bootstrap, the classes are applied perfectly.
I am puzzled as to why the problem occurs, as Bootstrap is loading in both cases, but the styles are only being applied when loading from the CDN.
Any thoughts on why this might be happening?
Edit: After experimenting, it turns out that loading the CSS directly instead of through the router works. Interestingly, the same line works fine in another file, indicating that the routing is functioning properly as the file is being loaded.