Home > Web Front-end > Bootstrap Tutorial > How to create a drop-down menu in bootstrap

How to create a drop-down menu in bootstrap

爱喝马黛茶的安东尼
Release: 2019-07-17 15:02:56
Original
4668 people have browsed it

How to create a drop-down menu in bootstrap

First, create a new HTML page in Sublime Text, as shown in the figure below. Be sure to select utf-8 for encoding.

How to create a drop-down menu in bootstrap

Then, we use the link tag to import the bootstrap style library, as shown below:

How to create a drop-down menu in bootstrap

Because click the drop-down The effect of the menu requires scripts, so you need to import jquery and bootstrap scripts, paying attention to the order.

How to create a drop-down menu in bootstrap

Next, the drop-down menu is officially introduced. We can directly call the dropdown style, which is the drop-down menu style defined by Bootstrap.

How to create a drop-down menu in bootstrap

Related recommendations: "bootstrap Getting Started Tutorial"

Then add the menu items in the drop-down menu, as shown in the figure below, please note The style is dropdown-menu.

How to create a drop-down menu in bootstrap

Finally we run the program and you can see the drop-down menu as shown below on the page.

How to create a drop-down menu in bootstrap

In addition, if you want to separate the menu items in the drop-down menu with dividing lines, you can directly add the divider style, as shown in the following figure:

How to create a drop-down menu in bootstrap

The above is the detailed content of How to create a drop-down menu in bootstrap. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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