Bootstrap样式下拉菜单

时间:2016-10-14 08:57:18

标签: html css twitter-bootstrap

我目前正在使用引导程序导航栏,但我想设置我的下拉列表, 我有一个"汉堡"样式下拉按钮,我当前的下拉列表如下所示:http://prntscr.com/ctocj2我需要做的是设置下拉列表的样式。 What i'm trying to accomplish is this



body {
    margin: 0;
    padding: 0;
    background-color: lightgrey;
}
.navbar-default {
    font-family: "Arial Rounded MT";
    font-weight: bold;
    font-size: 20px;
    position: relative;
    background-color: white;
    box-shadow: 20px;
    padding: 30px;
    border: none;
}
.navbar-header {
    right: auto;
}
.navbar-nav > li {} .navbar-default .navbar-brand,
.navbar-default .navbar-brand:hover,
.navbar-default .navbar-brand:focus {
    color: black;
    font-size: 30px;
}
.navbar-default .navbar-nav > li > a {
    color: #3E6AAF;
}
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
    color: #0042a5;
    opacity: 0.5;
}
.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
    color: #3E6AAF;
    background-color: transparent;
}
.navbar-default .navbar-text {
    color: #FFF;
}
.navbar-default .navbar-toggle {
    background-color: transparant;
    border: none;
}
.navbar-toggle .icon-bar {
    height: 8px;
    width: 50px;
    border-radius: 10px;
}
.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus {
    background-color: ;
}
.navbar-default .navbar-toggle .icon-bar {
    background-color: #3E6AAF;
    border: none;
}
.col-md-5 {
    font-family: "Lato-Bold";
    padding: 10px;
    color: white;
    font-size: 20px;
}
.col-md-12 {
    font-family: "Lato-Bold";
    height: 520px;
    padding: 10px;
    color: white;
}
.navbar-collapse {
    border: 0px;
}
.navbar-default .navbar-collapse {
    color: #e7e7e7;
}
.navbar-default .navbar-collapse,
.navbar-default .navbar-form {
    border-color: transparent;
    box-shadow: none;
}
.dropdown-menu {
    background-color: transparent;
    ;
    text-decoration-color: black;
}
.dropdown-toggle {
    background-color: transparent;
    color: black;
}
.navbar-default .navbar-nav .open .dropdown-menu>li>a,
.navbar-default .navbar-nav .open .dropdown-menu {
    background-color: black;
    color: white;
}
.navbar-right {
    padding-right: 100px;
}
.navbar-brand {
    position: relative;
    right: 15%;
    display: block;
    padding-top: -100px;
    width: 50%;
}

<!DOCTYPE html>
<html lang="en">
<head>
<title>Niet beschikbaar</title>
<link rel="shortcut icon" href="img/favicon2.ico" type="image/x-icon">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<link rel="stylesheet" href="css/style.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"> </script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"> </script>
</head>
<body>
<!-- NAVIGATIE BALK -->
<nav class="navbar navbar-default" role="navigation">
<!-- logo -->
<div class="navbar-header">
  <!--  -->
  <a class="pull-right navbar-brand" href="#">
    <img src="img/LOGOBIRSKEN2.svg"/>
  </a>

  <button type="button" class="pull-left navbar-toggle" data-toggle="collapse" data-target="#mainnavbar">
    <span class="icon-bar"></span>
    <span class="icon-bar"></span>
    <span class="icon-bar"></span>
  </button>
</div>

<div class="collapse navbar-collapse" id="mainnavbar">
  <ul class="nav navbar-nav">

    <li class="active"><a href="#">home</a></li>
    <li><a href="">over</a></li>
    <li><a href="#">diensten</a></li>
    <li><a href="#">contact</a></li>

  </ul>
</div>
</nav>
<div class="container-fluid">
</div>
&#13;
&#13;
&#13;

我希望你们能帮助我。

雷尼尔

注意:

仅适用于手机

1 个答案:

答案 0 :(得分:0)

雷尼尔

在你的style.css中破坏这个css

@media (max-width:767px) {
    .navbar-nav{ margin:0}
    .navbar-nav>li>a{padding-top: 20px;padding-bottom: 20px; border-top:8px solid #406bad}
    .navbar-nav>li:last-child>a{border-bottom:8px solid #406bad}
}