According to your code and description, I suggest you could change the class of nav tag from “navbar-default” to “navbar-inverse”, which is a built-in black navigation theme in Bootstrap.
If you have any other questions, please feel free to contact me any time.
Best regards,
Dillion
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Please add the following code into your style tag:
<style type="text/css">
/* for dropdown menu */
.navbar-inverse .dropdown-menu {
background-color: #333;
}
/* for items in dropdown menu */
.navbar-nav > li > .dropdown-menu a{ color: #E5E5E5; }
/* following is your style before */
</style>
The screenshot as below:
If you have any other questions, please feel free to contact me any time.
Best Regards,
Dillion
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
399 Points
1101 Posts
Menu Color
Jul 20, 2017 10:40 AM|asp.ambur|LINK
Hello
Im using this code
I want Menu Backgrodund Color to be Black
how to do so
All-Star
50831 Points
9895 Posts
Re: Menu Color
Jul 20, 2017 11:41 AM|A2H|LINK
You could set the color to navbar to change the background color
Aje
My Blog | Dotnet Funda
All-Star
45489 Points
7008 Posts
Microsoft
Re: Menu Color
Jul 21, 2017 02:48 AM|Zhi Lv - MSFT|LINK
Hi asp.ambur,
According to your code and description, I suggest you could change the class of nav tag from “navbar-default” to “navbar-inverse”, which is a built-in black navigation theme in Bootstrap.
Please refer to the following code:
<nav class="navbar navbar-inverse" role="navigation"> <div class="navbar-header"> ...
And the screenshot as below:
If you have any other questions, please feel free to contact me any time.
Best regards,
Dillion
Member
399 Points
1101 Posts
Re: Menu Color
Jul 21, 2017 09:14 AM|asp.ambur|LINK
Hello Zhi lv thanks for your code
I need menu item background also black how to do so
All-Star
50831 Points
9895 Posts
Re: Menu Color
Jul 21, 2017 06:39 PM|A2H|LINK
You can use the below css style to make the dropdownmenu list options also appear with black background color
Aje
My Blog | Dotnet Funda
Member
399 Points
1101 Posts
Re: Menu Color
Jul 22, 2017 05:49 PM|asp.ambur|LINK
All-Star
50831 Points
9895 Posts
Re: Menu Color
Jul 22, 2017 06:22 PM|A2H|LINK
Please post your updated code if possible
Aje
My Blog | Dotnet Funda
Member
399 Points
1101 Posts
Re: Menu Color
Jul 23, 2017 10:09 AM|asp.ambur|LINK
Below is my complete code format with
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server"> <title>Master Page</title> <link href="templatemo_style.css" rel="stylesheet" type="text/css" />
<script src="jquery-3.2.1.min.js"></script><script src="bootstrap.min.js"></script><link href="bootstrap.min.css" rel="stylesheet" /><link rel="stylesheet" href="Style/chosen.css" />
<script language="JavaScript" type="text/javascript">document.onmousedown=click;
function click() {if ((event.button==2)) {alert("Right Click Disabled");}}
function DIV1_onclick() {
}
</script>
<style type="text/css"> .dropdown-menu { min-width: 200px; }
.dropdown-menu.columns-2 { min-width: 800px; }
.dropdown-menu.columns-3 { min-width: 1100px; }
.dropdown-menu li a { padding: 5px 15px; font-weight: 100; }
.multi-column-dropdown { list-style: none; margin: 0px; padding: 0px; }
.multi-column-dropdown li a { display: block; clear: both; line-height: 1.0428571429; color: #333; white-space: normal; }
.multi-column-dropdown li a:hover { text-decoration: none; color: #18928f; background-color: #000000; }
@media (max-width: 767px) { .dropdown-menu.multi-column { min-width: 240px !important; overflow-x: hidden; } } </style>
</head>
<body onload="Maximise()"> <form id="form1" runat="server" >
<div> <table> <tr> <td colspan="3"> <nav class="navbar navbar-default navbar-fixed-top" role="navigation"> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li><a href="welcome.aspx">Home</a></li>
All-Star
45489 Points
7008 Posts
Microsoft
Re: Menu Color
Jul 24, 2017 02:15 AM|Zhi Lv - MSFT|LINK
Hi asp.ambur,
Please add the following code into your style tag:
The screenshot as below:
If you have any other questions, please feel free to contact me any time.
Best Regards,
Dillion
Member
399 Points
1101 Posts
Re: Menu Color
Jul 24, 2017 07:19 AM|asp.ambur|LINK
@Zhi Lv
Thanks For Your Code