Bootstrap CSS组件之下拉菜单(dropdown)

前端之家收集整理的这篇文章主要介绍了Bootstrap CSS组件之下拉菜单(dropdown)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

Bootstrap下拉菜单,常用在开发项目中,今天为大家介绍介绍

dropdown、dropdown-menu、dropdown-header、divider、dropdown-submenu 例子见下拉菜单.html

<div class="jb51code">
<pre class="brush:css;">
//源码
.dropup,.dropdown {
position: relative;
}
.dropdown-toggle:focus {
outline: 0;
}
.dropdown-menu {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
display: none;
float: left;
min-width: 160px;
padding: 5px 0;
margin: 2px 0 0;
font-size: 14px;
text-align: left;
list-style: none;
background-color: #fff;
-webkit-background-clip: padding-Box;
background-clip: padding-Box;
border: 1px solid #ccc;
border: 1px solid rgba(0,.15);
border-radius: 4px;
-webkit-Box-shadow: 0 6px 12px rgba(0,.175);
Box-shadow: 0 6px 12px rgba(0,.175);
}
.dropdown-menu.pull-right {
right: 0;
left: auto;
}
.dropdown-menu .divider {
height: 1px;
margin: 9px 0;
overflow: hidden;
background-color: #e5e5e5;
}
.dropdown-header {
display: block;
padding: 3px 20px;
font-size: 12px;
line-height: 1.42857143;
color: #777;
white-space: nowrap;
}

<div class="jb51code">
<pre class="brush:xhtml;">
<!DOCTYPE html>
<html lang="en">

<Meta charset="utf-8"> <Meta http-equiv="X-UA-Compatible" content="IE=edge"> <Meta name="viewport" content="width=device-width,initial-scale=1"> Bootstrap 101 Template

<link href="bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet">

<div class="dropdown">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
我的书籍<span class="caret">

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"&gt;
<script src="bootstrap-3.3.7-dist/js/bootstrap.min.js">

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持编程之家。

原文链接:https://www.f2er.com/bootstrap/43435.html

猜你在找的Bootstrap相关文章