'Why visual studio 2022 complains about unknown CSS class property bootstrap?
I have created a razor page web app template project in visual studio 2022.
I am adding some bootstrap CSS class.
here is my html:
<form method="get">
<div class="form-group">
<div class="input-group">
<input type="text" class="form-control" name="searchTerm" value=""/>
<span class="input-group-btn">
<button class="btn btn-primary">
<i class="glyphicon glyphicon-search"></i>
</button>
</span>
</div>
</div>
</form>
The template load bootstrap by default in the layout page.
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-zCbKRCUGaJDkqS1kPbPd7TveP5iyJE0EjAuZQTgFLD2ylzuqKfdKlfG/eSrtxUkn"
crossorigin="anonymous">
I tried referencing the CDN one even
However vs complains about not knowing these classes
form-group, input-group-btn, glyphicon glyphicon-search
Any reason ?
Solution 1:[1]
Is the href
value for your local copy of Bootstrap correct? I use LibMan in Visual Studio and and the default directory for Bootstrap is twitter-bootstrap
instead of bootstrap
. Therefore, the href
for me is ~/lib/twitter-bootstrap/css/bootstrap.min.css
.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Theophilus |