Home > Article > Web Front-end > Where is the bootstrap script code placed?
The Bootstrap JavaScript script should be placed at the bottom of the document, before the end of the <body> tag: Create a <script> tag that contains the path to bootstrap.min.js. Placing the <script> tag before the end of the </body> tag will help the page load faster.
Placement of Bootstrap script code
Bootstrap JavaScript script is usually placed at the bottom of the HTML document, <body>
before the closing tag of the tag.
Specific steps:
<script>
tag: <code class="html"><script src="bootstrap.min.js"></script></code>
Among them, bootstrap.min.js
is the compressed Bootstrap JavaScript file.
<script>
tag before the closing tag of the </body>
tag: <code class="html"></html> <body> <!-- 页面内容 --> <script src="bootstrap.min.js"></script> </body> </html></code>
Reason:
Placing script code at the bottom of the file prevents the browser from loading the script before parsing the HTML content. This helps increase page load speeds because the browser can load HTML and scripts in parallel.
The above is the detailed content of Where is the bootstrap script code placed?. For more information, please follow other related articles on the PHP Chinese website!