Copy link to clipboard
Copied
I built a website like all most a year ago with bootstrap. And just the other day, I added a drop down menu to my navigation. I need to modify some colors on the drop down and can't seem how to figure it out. Can someone help me, please?
https://forums.adobe.com/people/Jon+Fritz+II wrote
It's not on your web server, it's hosted at ajax.googleapis.com, you're linking to it using a <script> tag as Osgood posted.
You don't add Osgoods second code snippet to the script file, you add it after the script link on the page.
Yup, so bottom of page should look like below, once <script> block has been added:
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
$(function() {
...Copy link to clipboard
Copied
The simplest way to change colors is to use a Bootswatch Theme. The one below is called Flatly.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap 3.3.7 Starter</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Compiled and minified Bootstrap CSS, Bootswatch Flatly theme-->
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/flatly/bootstrap.min.css">
</head>
<body class="container">
<div class="row">
<div class="col-md-10 center-block">
<!--begin top nav bar-->
<nav class="navbar navbar-inverse" role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav navbar-left">
<li class="active"><a href="#">MENU 1</a></li>
<li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#">Dropdown <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">submenu 1-1</a></li>
<li><a href="#">submenu 1-2</a></li>
<li><a href="#">submenu 1-3</a></li>
</ul>
</li>
<li><a href="#">MENU 3</a></li>
<li><a href="#">MENU 4</a> </li>
<li><a href="#">MENU 5</a> </li>
<li><a href="#">MENU 6</a></li>
</ul>
</div>
<!--end top nav--> </nav>
</div>
</div>
<div class="row">
<div class="col-md-10 center-block">
PAGE CONTENT GOES HERE.....
</div>
</div>
<!--latest jQuery-->
<script src="https://code.jquery.com/jquery-1.12.2.min.js" integrity="sha256-lZFHibXzMHo3GGeehn1hudTAP3Sc0uKXBXAzHX1sjtk=" crossorigin="anonymous" defer>
</script>
<!--Bootstrap-->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous" defer></script>
<!--Google Analytics Tracking Code here....-->
</body>
</html>
More Bootswatch Themes available:
Copy link to clipboard
Copied
How do I change the theme I have now. This is all new to me.
Copy link to clipboard
Copied
The code I posted above tells all.
Nancy
Copy link to clipboard
Copied
So I would replace this in my header.php and then change my navigation?
Copy link to clipboard
Copied
Wherever you have your CSS defined will be replaced with this:
<!-- Compiled and minified Bootstrap CSS, Bootswatch Flatly theme-->
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/flatly/bootstrap.min.css">
If you prefer to use another Theme, change its name accordingly to one of the free Bootswatch Theme choices. https://bootswatch.com/
cerulean
cosmo
cyborg
darkly
flatly
journal
lumen
paper
readable
sandstone
simplex
slate
spacelab
superhero
united
yeti
Nancy
Copy link to clipboard
Copied
I replaced this
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
with this
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/flatly/bootstrap.min.css">
Copy link to clipboard
Copied
I made the changes but still can't seem to be able to access the code in the drop menu to change the colors.
Copy link to clipboard
Copied
Your custom CSS is probably overriding the CSS Theme. Try disabling it.
Nancy
Copy link to clipboard
Copied
I tried that, and I lose everything. There is a funny green when you click on Links tab. I want to get rid of that and I want the sub menus to act like the other tabs. there black and when you hover over them they go white.
Copy link to clipboard
Copied
jaspermaxx44 wrote
I tried that, and I lose everything. There is a funny green when you click on Links tab. I want to get rid of that and I want the sub menus to act like the other tabs. there black and when you hover over them they go white.
Since you have an id set on your navbar use that. Put the below in your custom.css stylesheet - change the background-color: #889C3A and hover background-color: #476E2C to what colors you require.
#myNavbar .dropdown-menu a {
background-color: #889C3A;
padding: 10px 15px;
color: #fff;
}
#myNavbar .dropdown-menu a:hover {
background-color: #476E2C;
}
#myNavbar .dropdown-menu {
padding: 0;
border: 1px solid #fff;
}
#myNavbar .dropdown-menu li {
border-bottom: none;
border-bottom: 1px solid #fff;
}
#myNavbar .dropdown-menu li:last-child {
border-bottom: none;
}
Copy link to clipboard
Copied
This has been very helpful. The only thing I can't get rid of is the dark green when you click on the Links tab. But this is way better.
Copy link to clipboard
Copied
jaspermaxx44 wrote
This has been very helpful. The only thing I can't get rid of is the dark green when you click on the Links tab. But this is way better.
Add the below css style to your styles.css file:
.navbar-inverse .navbar-nav>.active> a {
background-color: transparent!important;
}
Then add the below code AFTER the link to your 1.12.4/jquery.min.js file, at the foot of the page
<script>
$(function() {
var selector = '.nav li';
$(selector).on('click', function(){
$(selector).removeClass('active');
$(this).addClass('active');
});
});
</script>
Copy link to clipboard
Copied
I can't seem to find 1.12.4/jquery.min.js file,
Copy link to clipboard
Copied
jaspermaxx44 wrote
I can't seem to find 1.12.4/jquery.min.js file,
At the bottom of the page, first link after <!--jQuery library --> I've highlighted it in red:
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="chatSocketAchex.js"></script>
<script type="text/javascript">
$("#Chatroom").ChatSocket();
</script>
</body>
</html>
Copy link to clipboard
Copied
Where is this page hidden? I went through all my files on my website.
Copy link to clipboard
Copied
jaspermaxx44 wrote
Where is this page hidden? I went through all my files on my website.
Its the one you linked to in your first post:
It should be there in ALL your pages to make the Bootstrap navigation function
Copy link to clipboard
Copied
Found it. It was in my footer.php file. thanks so much for your patience.
Copy link to clipboard
Copied
On your index page. jQuery appears on line 149 of your code. If that is supplied by a server-side include, you will no doubt find it in there.
Copy link to clipboard
Copied
It's not on your web server, it's hosted at ajax.googleapis.com, you're linking to it using a <script> tag as Osgood posted.
You don't add Osgoods second code snippet to the script file, you add it after the script link on the page.
Copy link to clipboard
Copied
https://forums.adobe.com/people/Jon+Fritz+II wrote
It's not on your web server, it's hosted at ajax.googleapis.com, you're linking to it using a <script> tag as Osgood posted.
You don't add Osgoods second code snippet to the script file, you add it after the script link on the page.
Yup, so bottom of page should look like below, once <script> block has been added:
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
$(function() {
var selector = '.nav li';
$(selector).on('click', function(){
$(selector).removeClass('active');
$(this).addClass('active');
});
});
</script>
<!-- Latest compiled JavaScript -->
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="chatSocketAchex.js"></script>
<script type="text/javascript">
$("#Chatroom").ChatSocket();
</script>
</body>
</html>
Copy link to clipboard
Copied
I think the menu looks better without your custom styles.
Copy link to clipboard
Copied
https://forums.adobe.com/people/Nancy+OShea wrote
I think the menu looks better without your custom styles.
Looks more SOPHISTICATED apart from that awful white padding Bootstrap leaves top and bottom of the nav items.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now