Bootstrap application in ASP.NET Core 2

Asked

Viewed 35 times

0

Good morning, I have an application in ASP.NET Core 2 where I use the latest version of Bootstrap(4.3.1), I took some codes in the documentation but when I put them in my HTML they always appear without the layout, only the texts as if the CSS was not loaded

<head>
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
    </head>
    <nav class="navbar navbar-expand-lg navbar-light bg-light">
        <a class="navbar-brand" href="#">Principal</a>
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarNav">
            <ul class="navbar-nav">
                <li class="nav-item">
                    <a class="nav-link" asp-area="" asp-controller="Home" asp-action="Index">Home</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" asp-controller="ConsultaCarros" asp-action="Index">Consulta carros</a>
                </li>
    
            </ul>
        </div>
    </nav>
    
    <div class="container mt-3">
     <div class="panel panel-success">
                    <div class="panel-heading">Panel with panel-success class</div>
                    <div class="panel-body">Panel Content</div>
     </div>
     </div>

Panel does not inherit CSS, as I should?

  • Some error appears in the console?

  • No, no mistakes appear

  • Just testing this piece of code on a . blank html worked normally....

  • Check to see if your application can download the CSS files (viewing through the browser Networking). If so, try to download the files and place them locally within the project and make the appropriate path changes. Also do the cache test and see if you can’t get in the way of anything. Test and see if it works. I had a similar problem, but the proxy blocked the download of some files when loaded by Link on the head.

1 answer

0

Browser other questions tagged

You are not signed in. Login or sign up in order to post.