Home > Web Front-end > Bootstrap Tutorial > An in-depth analysis of the drop-down menu component in Bootstrap

An in-depth analysis of the drop-down menu component in Bootstrap

青灯夜游
Release: 2021-02-18 22:45:26
forward
2520 people have browsed it

An in-depth analysis of the drop-down menu component in Bootstrap

Related recommendations: "bootstrap Tutorial"

The drop-down menu component in the bootstrap framework is an independent component. According to different version, its corresponding file:

less. The corresponding source code file is: dropdowns.less

sass. The corresponding source code file is: _dropdowns. scss

When using the drop-down menu built by bootstrap, you must call the bootstrap.js file provided by the bootstrap framework. For the uncompiled version, you can find a file named dropdown.js under js, and you can also call this file. You can also call the compressed file bootstrap.min.js

Since the interactive effects of bootstrap components all rely on plug-ins written by the jQuery library, you must be sure before using bootstrap.min.js First load jQuery.min.js

Example on the official website:

<div class="dropdown"> <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown">

下拉菜单

<span class="caret"></span> </button> <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1"> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">下拉菜单项</a></li>

   …
   
<li role="presentation" class="divider"></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">下拉菜单项</a></li> </ul> </div>
Copy after login

Detailed explanation:

1. Use a dropdown The container wraps the entire drop-down menu element

<div class="dropdown"></div>
Copy after login

2, uses the

Related labels:
source:cnblogs.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template