Gopal
Gopal

Reputation: 795

bootstrap icon not loading however available in node_modules

I have download npm install bootstrap-icons --save and it was downloaded successfully inside node_modules..

in the html file when i include it is not showing icon however works only when i include using hyperlink.

Not working one

<link  type="text/css" href="node_modules/bootstrap-icons/font/bootstrap-icons.css">

Working one

<!--
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
-->

html file

<link rel="stylesheet" type="text/css" href="css/style.css" />
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<!-- Bootstrap CSS -->
<link rel="stylesheet" type="text/css" href="node_modules/bootstrap/dist/css/bootstrap.min.css">
<link  type="text/css" href="node_modules/bootstrap-icons/font/bootstrap-icons.css">


<!--
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
-->


<script type="text/javascript" src="./script/jretrieve.js"> </script>


<!-- jQuery first, then Popper.js, then Bootstrap JS. -->
<script type="text/javascript" src="./node_modules/jquery/dist/jquery.slim.min.js"></script>
<script type="text/javascript" src="./node_modules/popper.js/dist/umd/popper.min.js"></script>
<script type="text/javascript" src="./node_modules/bootstrap/dist/js/bootstrap.min.js"></script>

Upvotes: 0

Views: 1496

Answers (1)

yogski
yogski

Reputation: 301

Try this:

<link rel="stylesheet" type="text/css" href="./node_modules/bootstrap-icons/font/bootstrap-icons.css">

The difference is putting dot-and-slash ./ to state a relative path.

Upvotes: 1

Related Questions