When hovering dropdown items in the hamburger menu, their contents are shown like this:
I'd like to disable this behavior on hover, so they are only shown when the dropdown is clicked.
Tried this, no luck.
#media only screen and (min-width: 768px) {
li.dropdown:hover > ul {
display: none;
}
}
.navbar {
border: none;
}
.dropdown-menu {
background-color: #f5f5f5;
}
.navbar-header {
background-color: #3a7dbb;
}
.collapse.navbar-collapse.js-navbar-collapse {
background-color: #3a7dbb;
}
.navbar-default .navbar-nav > li > a.dropdown-toggle {
font-family: "Oswald",Helvetica,Arial,sans-serif;
font-size: 18px;
color: white;
}
.dropdown > .dropdown-menu > li > a {
font-size: 16px;
}
.glyphicon-shopping-cart:before {
color: white;
}
.navbar .navbar-brand {
padding-top: 0px;
}
.navbar .navbar-brand > img{
height: 100%;
}
.dropdown > .dropdown-menu > li > a:hover {
background-color: white;
}
.navbar-nav > li > .dropdown-menu {
background-color: #f5f5f5;
margin-top: 20px;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
.navbar-default .navbar-nav > li > a {
/* width: 8em; */
font-weight: bold;
}
.mega-dropdown {
position: static !important;
width: 100%;
}
.mega-dropdown-menu {
padding: 20px 0px;
width: 100%;
box-shadow: none;
-webkit-box-shadow: none;
}
.center {
margin: auto;
}
.mega-dropdown-menu > li > ul {
padding: 0;
margin: 0;
}
.mega-dropdown-menu > li > ul > li {
list-style: none;
}
.mega-dropdown-menu > li > ul > li > a {
display: block;
padding: 3px 20px;
clear: both;
font-weight: normal;
line-height: 1.428571429;
color: #262626;
white-space: normal;
}
.mega-dropdown-menu > li ul > li > a {
font-size: 16px;
}
.mega-dropdown-menu > li ul > li > a:hover,
.mega-dropdown-menu > li ul > li > a:focus {
text-decoration: none;
color: #444;
background-color: white;
}
li.dropdown:hover {
background-color: #c3c1c1;
}
ul.dropdown-menu.mega-dropdown-menu.row {
width: 80%;
left: 0;
right: 0;
margin: 0 auto; /* Centers the element */
}
.mega-dropdown-menu .dropdown-header {
color: #428bca;
font-size: 18px;
font-weight: bold;
}
.mega-dropdown-menu .dropdown-header > a {
color: #428bca;
font-size: 18px;
font-weight: bold;
padding-left: 0;
}
.mega-dropdown-menu form {
margin: 3px 20px;
}
.mega-dropdown-menu .form-group {
margin-bottom: 3px;
}
.navbar-default .navbar-nav .open .dropdown-menu > li > a {
color: black !important;
}
/* .mega-dropdown-menu:before {
content: "";
border-bottom: 15px solid #fff;
border-right: 17px solid transparent;
border-left: 17px solid transparent;
position: absolute;
top: -15px;
left: 285px;
z-index: 10;
}
.mega-dropdown-menu:after {
content: "";
border-bottom: 17px solid #ccc;
border-right: 19px solid transparent;
border-left: 19px solid transparent;
position: absolute;
top: -17px;
left: 283px;
z-index: 8;
} */
.dropdown:hover .dropdown-menu {
display: block;
margin-top: 0; // remove the gap so it doesnt close
}
#main_pnlSiteTemplateHeader {
background-color: white;
padding-left: 0px;
padding-right: 0px;
}
#main_content_Content {
padding-top: 80px;
}
#main_content_TopBanner {
padding-top: 80px;
}
ul.dropdown-menu.mega-dropdown-menu.row {
top: 49px;
}
#media only screen and (min-width: 768px) {
.dropdown:hover > .dropdown-menu {
display: block;
}
.dropdown > .dropdown-toggle:active {
pointer-events: none;
}
}
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Oswald|Open+Sans:400,400italic,600italic,600">
<!------ Include the above in your HEAD tag ---------->
<div class="">
<nav class="navbar navbar-default navbar-fixed-top">
<div class="navbar-header">
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".js-navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse js-navbar-collapse">
<ul class="nav navbar-nav">
<li class="dropdown mega-dropdown">
About<span class="caret"></span>
<ul class="dropdown-menu mega-dropdown-menu row">
<li class="col-sm-4">
<ul>
<li class="dropdown-header">Business Relationship Management</li>
<li>Capability</li>
<li>Role</li>
</ul>
</li>
<li class="col-sm-4">
</li>
<li class="col-sm-4">
</li>
</ul>
</li>
</ul>
</div>
</nav>
</div>
please try below css:
<style>
.dropdown:hover > .dropdown-menu {
display: none;
}
.navbar-default .navbar-nav > li > a:focus + ul.dropdown-menu {
display: block;
top: auto;
width: 100%;
margin-top: 7px;
}
</style>
I read other questions here on stackoverflow but I can't figure out (not working), how to center a navbar menu and logo between 767px and 992px for mobile devices...
For PC is:
----------- simple links menu--
-- logo ------------- navmenu--
...and for small devices > 767px and < 992px should be in 3 lines, all centered:
------ simple links menu ------
-------------- logo -----------
------------ navmenu ----------
Under 767px it's good - there is a collapse menu...
Here is code only for header nav and full css:
#import url("http://fonts.googleapis.com/css?family=Libre+Baskerville:400italic");
#import url("http://fonts.googleapis.com/css?family=Lato:400,700,400italic");
/* ------------------------------------------------------------------
General Styles
------------------------------------------------------------------ */
body {
background: #212121;
overflow-x: hidden;
-ms-overflow-style: scrollbar;
font: 400 16px/1.8 "Lato", sans-serif;
color: #eee;
}
img {
max-width: 100%;
height: auto;
}
iframe {
border: 0;
}
/* ------------------------------------------------------------------
Selection
------------------------------------------------------------------ */
::-moz-selection {
background: #000;
color: #fff;
}
::-webkit-selection {
background: #000;
color: #fff;
}
::selection {
background: #000;
color: #fff;
}
/* ------------------------------------------------------------------
Transition elsements
------------------------------------------------------------------- */
a,
.btn {
-webkit-transition: all 0.3s cubic-bezier(0.300, 0.100, 0.580, 1.000);
-moz-transition: all 0.3s cubic-bezier(0.300, 0.100, 0.580, 1.000);
-o-transition: all 0.3s cubic-bezier(0.300, 0.100, 0.580, 1.000);
transition: all 0.3s cubic-bezier(0.300, 0.100, 0.580, 1.000);
}
/* ------------------------------------------------------------------
Reset box-shadow
------------------------------------------------------------------- */
.btn,
.well,
.panel,
.progress,
.form-control, .form-control:hover, .form-control:focus {
-webkit-box-shadow: none;
-moz-box-shadow: none;
-ms-box-shadow: none;
-o-box-shadow: none;
box-shadow: none;
}
/* ------------------------------------------------------------------
Reset border-radius
------------------------------------------------------------------- */
.well, .label, .alert,
.modal-content {
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
-ms-border-radius: 2px;
-o-border-radius: 2px;
border-radius: 2px;
}
/* ------------------------------------------------------------------
Typography
------------------------------------------------------------------- */
a {
color: rgba(17, 17, 17, 0.55);
}
a:hover, a:focus {
text-decoration: none;
color: #fafafa;
outline: 0;
}
/* ------------------------------------------------------------------
Tabs and Accordion
------------------------------------------------------------------- */
.nav-tabs {
border-color: #fafafa;
}
.nav-tabs > li > a {
font-size: 12px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
-o-border-radius: 2px;
border-radius: 2px;
}
.nav-tabs >li.active > a,
.nav-tabs >li.active > a:hover,
.nav-tabs >li.active > a:focus {
border: 1px solid #fafafa;
border-bottom-color: transparent;
}
.nav-tabs > li > a:hover,
.nav-tabs > li > a:focus {
background: #fafafa;
}
.tab-content {
border: 1px solid #fafafa;
border-top: 0;
padding: 15px;
}
.tab-content :last-child {
margin-bottom: 0;
}
/* ------------------------------------------------------------------
Navigation
------------------------------------------------------------------- */
.navbar-custom {
-webkit-transition: background 0.3s cubic-bezier(0.300, 0.100, 0.580, 1.000), padding 0.3s cubic-bezier(0.300, 0.100, 0.580, 1.000);
-moz-transition: background 0.3s cubic-bezier(0.300, 0.100, 0.580, 1.000), padding 0.3s cubic-bezier(0.300, 0.100, 0.580, 1.000);
-o-transition: background 0.3s cubic-bezier(0.300, 0.100, 0.580, 1.000), padding 0.3s cubic-bezier(0.300, 0.100, 0.580, 1.000);
transition: background 0.3s cubic-bezier(0.300, 0.100, 0.580, 1.000), padding 0.3s cubic-bezier(0.300, 0.100, 0.580, 1.000);
}
.navbar-custom {
background: #212121;
border: 0;
text-transform: uppercase;
letter-spacing: 2px;
font-size: 12px;
webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
-moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}
.navbar-custom .navbar-brand {
float: none;
height: 60px;
display: table-cell;
vertical-align: middle;
padding-top: 0;
padding-bottom: 0;
letter-spacing: 4px;
font-weight: 400;
font-size: 20px;
color: #fafafa;
}
.navbar-custom a,
.navbar-custom .navbar-brand {
color: #fafafa;
-webkit-transition: none;
-moz-transition: none;
-o-transition: none;
transition: none;
}
.navbar-custom .nav li > a {
position: relative;
}
.navbar-custom .nav > li > a:focus,
.navbar-custom .nav > li > a:hover,
.navbar-custom .nav .open > a,
.navbar-custom .nav .open > a:focus,
.navbar-custom .nav .open > a:hover,
.navbar-custom .dropdown-menu > li > a:focus,
.navbar-custom .dropdown-menu > li > a:hover {
background: none;
color: #757575;
}
/* Navbar toggle */
.navbar-custom .navbar-toggle {
margin-top: 13px;
}
.navbar-custom .navbar-toggle .icon-bar {
background: #bdbdbd;
}
/* Navbar dropdown */
.navbar-custom .dropdown-menu {
background: #212121;
border: 1px solid rgba(0, 0, 0, 0.05);
border-radius: 0;
padding: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
.dropdown-menu > li > a {
display: block;
padding: 3px 20px;
clear: both;
font-weight: normal;
line-height: 1.42857143;
color: #fafafa;
white-space: nowrap;
}
.navbar-custom .dropdown-menu > li > a {
border: 0;
text-transform: uppercase;
letter-spacing: 2px;
font-size: 10px;
padding: 11px 15px;
}
.navbar-custom .dropdown-menu .dropdown-menu {
top: 0;
left: 100%;
right: auto;
margin-top: -1px;
}
.leftauto {
right: 0 !important;
left: auto !important;
}
.navbar-custom .dropdown-menu.left-side {
right: 100%;
left: auto;
}
.navbar-custom .dropdown-toggle:after {
position: absolute;
display: block;
right: 0;
top: 50%;
margin-top: -5px;
font: normal normal normal 14px/1 FontAwesome;
font-size: 9px;
content: "\f107";
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.navbar-custom .navbar-nav > .dropdown > .dropdown-toggle {
padding-right: 28px;
}
.navbar-custom .navbar-nav > .dropdown > .dropdown-toggle:after {
position: absolute;
display: block;
right: 15px;
top: 50%;
margin-top: -5px;
font: normal normal normal 14px/1 FontAwesome;
font-size: 9px;
content: "\f107";
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.light-logo {
display: none !important;
}
.navbar-transparent.navbar-dark .light-logo {
display: block !important;
}
.navbar-transparent.navbar-dark .dark-logo {
display: none !important;
}
/* Push search */
.navbar-custom .navbar-nav > .dropdown > .dropdown-toggle.search-dropdown:after {
content: "";
}
.dropdown-search {
position: relative;
padding: 7px 5px;
}
.dropdown-search .form-control {
position: relative;
}
.dropdown-search .search-btn {
position: absolute;
background: transparent;
border: none;
overflow: hidden;
top: 50%;
right: 0px;
width: 42px;
height: 32px;
line-height: 30px;
font-size: 14px;
outline: none;
color: #fafafa;
margin-top: -16px;
}
/* ------------------------------------------------------------------
Hero
------------------------------------------------------------------- */
.module-hero {
position: relative;
background-repeat: no-repeat;
background-position: center center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.hero-caption {
display: table;
height: 100%;
width: 100%;
text-align: center;
}
.hero-text {
position: relative;
display: table-cell;
vertical-align: middle;
height: 100%;
}
/* Hero caption sizes */
.mh-line-size-1,
.mh-line-size-2,
.mh-line-size-3,
.mh-line-size-4,
.mh-line-size-5,
.mh-line-size-6 {
font-weight: 700;
opacity: 0.99;
margin: 0;
}
.mh-line-size-1 {
letter-spacing: 50px;
font-size: 26px;
}
.mh-line-size-2 {
letter-spacing: 40px;
font-size: 24px;
}
.mh-line-size-3 {
letter-spacing: 12px;
font-size: 22px;
}
.mh-line-size-4 {
letter-spacing: 8px;
font-size: 14px;
}
.mh-line-size-5 {
letter-spacing: 6px;
font-size: 12px;
}
.mh-line-size-6 {
font-weight: 400;
font-size: 16px;
}
/* ------------------------------------------------------------------
Modules
------------------------------------------------------------------- */
.amber {color: ;}
.wrapper {
background: #212121;
overflow: hidden;
margin: 0 auto;
width: 100%;
}
.module,
.module-small {
padding: 140px 0;
position: relative;
background-repeat: no-repeat;
background-position: center center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.module-small {
padding: 70px 0;
}
.navbar-custom + .module {
padding: 200px 0;
}
.navbar-custom + .module-small {
padding: 130px 0;
}
.module-parallax {
background-attachment: fixed;
}
/* Module titles */
.module-title {
text-transform: uppercase;
letter-spacing: 10px;
text-align: center;
font-size: 20px;
margin-bottom: 70px;
}
.module-subtitle {
text-align: center;
font-size: 15px;
margin-bottom: 70px;
}
.module-icon {
font-size: 36px;
margin-bottom: 70px;
}
.module-title + .module-subtitle {
margin-top: -35px;
}
.divider {
margin: 0;
}
.copyright {
padding: 0 5px;
}
/* -------------------------------------------------------------------
Responsive Media Queries
------------------------------------------------------------------- */
#media (min-width: 768px) {
/* Navbar */
.navbar-nav {
margin: 5px -15px;
}
.navbar-custom .navbar-brand {
padding-left: 0;
}
.navbar-custom .navbar-nav > li > a {
padding-top: 20px;
padding-bottom: 20px;
}
.navbar-transparent {
background: transparent;
padding-top: 15px;
padding-bottom: 15px;
background: transparent;
webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
/* Tra */
.navbar-transparent.navbar-dark .navbar-nav > li > a,
.navbar-transparent.navbar-dark .navbar-brand {
color: #212121;
}
.navbar-transparent.navbar-dark .nav > li > a:focus,
.navbar-transparent.navbar-dark .nav > li > a:hover {
color: rgba(255, 255, 255, 0.75);
}
.navbar-custom .dropdown-menu .dropdown-toggle:after {
position: absolute;
display: block;
right: 9px;
top: 50%;
margin-top: -6px;
font: normal normal normal 14px/1 FontAwesome;
font-size: 12px;
content: "\f105";
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.navbar-custom .dropdown-menu {
position: absolute;
display: block;
visibility: hidden;
opacity: 0;
}
.navbar-custom .open > .dropdown-menu {
visibility: visible;
opacity: 1;
}
.navbar-right .dropdown-menu {
right: auto;
left: 0;
}
/* Comments */
.comment .comment {
margin-left: 100px;
}
}
#media (max-width: 992px) {
/* Hero captions */
.mh-line-size-1 {
letter-spacing: 40px;
font-size: 26px;
}
.mh-line-size-2 {
letter-spacing: 28px;
font-size: 20px;
}
.mh-line-size-3 {
letter-spacing: 20px;
font-size: 22px;
}
.mh-line-size-4 {
letter-spacing: 8px;
font-size: 16px;
}
.navbar-custom {
letter-spacing: 1px;
font-size: 12px;
}
/* Portfolio grid */
.work-item,
.grid-sizer {
width: 33.3333%;
}
.work-item.wide,
.work-item.wide-tall {
width: 66.6666%;
}
}
#media (max-width: 767px) {
/* Navbar */
.navbar-custom {
letter-spacing: 2px;
font-size: 10px;
}
.navbar-transparent.navbar-dark .light-logo {
display: none !important;
}
.navbar-transparent.navbar-dark .dark-logo {
display: block !important;
}
.navbar-custom .navbar-nav .open .dropdown-menu > li > a,
.navbar-custom .navbar-nav .open .dropdown-menu .dropdown-header {
padding: 10px 25px;
}
.navbar-custom .navbar-nav .open .dropdown-menu .dropdown-menu .dropdown-header,
.navbar-custom .navbar-nav .open .dropdown-menu .dropdown-menu > li > a {
padding: 10px 35px;
}
.navbar-custom .dropdown-toggle:after, .navbar-custom .dropdown-menu .dropdown-toggle:after {
right: 15px;
content: "\f107";
}
.navbar-custom .nav > .open >.dropdown-toggle:after, .navbar-custom .dropdown-menu .dropdown.open .dropdown-toggle:after {
right: 15px;
content: "\f106";
}
/* Hero captions */
.mh-line-size-1 {
letter-spacing: 24px;
font-size: 26px;
}
.mh-line-size-2 {
letter-spacing: 16px;
font-size: 15px;
}
.mh-line-size-3 {
letter-spacing: 14px;
font-size: 14px;
}
.mh-line-size-4 {
letter-spacing: 4px;
font-size: 14px;
}
.mh-line-size-5 {
letter-spacing: 2px;
font-size: 13px;
}
.mh-line-size-6 {
font-size: 13px;
}
/* Portfolio filters */
.filters li {
display: block;
margin: 0 10px 10px;
}
.filters li:last-child {
margin: 0 10px 140px;
}
/* Portfolio grid */
.work-item,
.grid-sizer {
width: 50%;
}
.work-item.wide,
.work-item.wide-tall {
width: 100%;
}
}
#media (max-width: 500px) {
/* Hero captions */
.mh-line-size-1 {
letter-spacing: 12px;
font-size: 26px;
}
.mh-line-size-2 {
letter-spacing: 6px;
font-size: 14px;
}
.mh-line-size-3 {
letter-spacing: 4px;
font-size: 13px;
}
.mh-line-size-4 {
letter-spacing: 4px;
font-size: 12px;
}
.mh-line-size-5 {
letter-spacing: 2px;
font-size: 11px;
}
.mh-line-size-6 {
font-size: 12px;
}
/* Portfolio grid */
.work-item,
.grid-sizer {
width: 100%;
}
.work-item.wide,
.work-item.wide-tall {
width: 100%;
}
}
/* -------------------------------------------------------------------
Multi-columns-row
------------------------------------------------------------------- */
.multi-columns-row .first-in-row {
clear: left;
}
.multi-columns-row .col-xs-6:nth-child(2n + 3) { clear: left; }
.multi-columns-row .col-xs-4:nth-child(3n + 4) { clear: left; }
.multi-columns-row .col-xs-3:nth-child(4n + 5) { clear: left; }
.multi-columns-row .col-xs-2:nth-child(6n + 7) { clear: left; }
.multi-columns-row .col-xs-1:nth-child(12n + 13) { clear: left; }
#media (min-width: 768px) {
.multi-columns-row .col-xs-6:nth-child(2n + 3) { clear: none; }
.multi-columns-row .col-xs-4:nth-child(3n + 4) { clear: none; }
.multi-columns-row .col-xs-3:nth-child(4n + 5) { clear: none; }
.multi-columns-row .col-xs-2:nth-child(6n + 7) { clear: none; }
.multi-columns-row .col-xs-1:nth-child(12n + 13) { clear: none; }
.multi-columns-row .col-sm-6:nth-child(2n + 3) { clear: left; }
.multi-columns-row .col-sm-4:nth-child(3n + 4) { clear: left; }
.multi-columns-row .col-sm-3:nth-child(4n + 5) { clear: left; }
.multi-columns-row .col-sm-2:nth-child(6n + 7) { clear: left; }
.multi-columns-row .col-sm-1:nth-child(12n + 13) { clear: left; }
}
#media (min-width: 992px) {
.multi-columns-row .col-sm-6:nth-child(2n + 3) { clear: none; }
.multi-columns-row .col-sm-4:nth-child(3n + 4) { clear: none; }
.multi-columns-row .col-sm-3:nth-child(4n + 5) { clear: none; }
.multi-columns-row .col-sm-2:nth-child(6n + 7) { clear: none; }
.multi-columns-row .col-sm-1:nth-child(12n + 13) { clear: none; }
.multi-columns-row .col-md-6:nth-child(2n + 3) { clear: left; }
.multi-columns-row .col-md-4:nth-child(3n + 4) { clear: left; }
.multi-columns-row .col-md-3:nth-child(4n + 5) { clear: left; }
.multi-columns-row .col-md-2:nth-child(6n + 7) { clear: left; }
.multi-columns-row .col-md-1:nth-child(12n + 13) { clear: left; }
}
#media (min-width: 1200px) {
.multi-columns-row .col-md-6:nth-child(2n + 3) { clear: none; }
.multi-columns-row .col-md-4:nth-child(3n + 4) { clear: none; }
.multi-columns-row .col-md-3:nth-child(4n + 5) { clear: none; }
.multi-columns-row .col-md-2:nth-child(6n + 7) { clear: none; }
.multi-columns-row .col-md-1:nth-child(12n + 13) { clear: none; }
.multi-columns-row .col-lg-6:nth-child(2n + 3) { clear: left; }
.multi-columns-row .col-lg-4:nth-child(3n + 4) { clear: left; }
.multi-columns-row .col-lg-3:nth-child(4n + 5) { clear: left; }
.multi-columns-row .col-lg-2:nth-child(6n + 7) { clear: left; }
.multi-columns-row .col-lg-1:nth-child(12n + 13) { clear: left; }
}
.et-icons .box1 {
border: 1px solid #fafafa;
display: block;
width: 25%;
float: left;
padding: 0;
font-size: 13px;
margin: -1px 0 0 -1px;
}
.et-icons .box1 > span {
display: inline-block;
border-right: 1px solid #fafafa;
min-width: 60px;
min-height: 60px;
text-align: center;
line-height: 60px;
font-size: 28px;
margin-right: 5px;
}
.fa-icons {
padding: 0 15px;
}
.fa-icons > div {
padding: 0;
border: 1px solid #fafafa;
margin: -1px 0 0 -1px;
font-size: 13px;
}
.fa-icons > div > i {
display: inline-block;
margin-right: 5px;
min-width: 40px;
min-height: 40px;
border-right: 1px solid #fafafa;
line-height: 40px;
text-align: center;
font-size: 14px;
}
/* ------- CUSTOM Styles ------*/
h1 small, h2 small, h3 small, h4 small, h5 small, h6 small, .h1 small, .h2 small, .h3 small, .h4 small, .h5 small, .h6 small, h1 .small, h2 .small, h3 .small, h4 .small, h5 .small, h6 .small, .h1 .small, .h2 .small, .h3 .small, .h4 .small, .h5 .small, .h6 .small {
font-weight: normal;
line-height: 1;
color: #9e9e9e;
}
.amber {color: #EB9532;}
.text-21 {color: #212121 !important;}
.bk h1, .bk .h1,
.bk h5, .bk .h5
{
line-height: 1.4;
font-weight: bold;
color: #212121 !important;
}
.module-divider {
height: 20px;
width: 100%;
background-color: #212121;
}
.vofset { padding-top: 5px !important; padding-bottom: 5px !important;}
.vofset0 { padding-top: 0px; }
.vofset1 { padding-top: 10px; }
.vofset2 { padding-top: 20px; }
.vofset3 { padding-top: 30px; }
.vofset4 { padding-top: 40px; }
.vofset5 { padding-top: 50px; }
.vofset7 { padding-top: 70px; }
.vofset10 { padding-top: 100px; }
.vofset12 { padding-top: 120px; }
.vofset14 { padding-top: 140px; }
.lofset1 { padding-bottom: 10px; }
.lofset2 { padding-bottom: 20px; }
.lofset3 { padding-bottom: 30px; }
.lofset4 { padding-bottom: 40px; }
.lofset5 { padding-bottom: 50px; }
.lofset7 { padding-bottom: 70px; }
.lofset10 { padding-bottom: 100px; }
.lofset12 { padding-bottom: 120px; }
.lofset14 { padding-bottom: 140px; }
.img-responsive,
.thumbnail > img,
.thumbnail a > img,
.carousel-inner > .item > img,
.carousel-inner > .item > a > img {
display: block;
max-width: 100%;
height: auto;
margin: 0 auto;
}
.navbar {
min-height: 90px;
}
.navbar-custom {
padding-top: 10px;
}
.navbar-top {
padding: 5px 0px;
margin: 0px -15px;
position: relative;
background-repeat: no-repeat;
text-transform: uppercase;
letter-spacing: 0px;
text-align: right;
font-size: 10px;
color: #9e9e9e;
background: #212121;
}
.navbar-top a {
margin: 0px 0px 0px 15px !important;
color: #9e9e9e;
text-decoration: none;
text-transform: uppercase;
font: "Lato", sans-serif;
line-height: 20px;
font-size: 12px;
letter-spacing: 1px;
font-weight: bold;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
transition-delay: 0s;
transition-duration: 0s;
transition-property: none;
transition-timing-function: ease;
}
.navbar-top a:hover {
color: #eee;
}
.navbar-custom .navbar-toggle .icon-bar {
background: #e9e9e9;
}
.navbar-toggle .icon-bar+.icon-bar {
margin-top: 8px;
}
.navbar-toggle .icon-bar {
margin-top: 3px;
display: block;
width: 22px;
height: 2px;
border-radius: 1px;
}
<!-- NAVIGATION -->
<nav class="navbar navbar-custom navbar-fixed-top">
<div class="container">
<div class="row">
<div class="col-xs-12 navbar-top hidden-xs">
Simple Links Here
</div>
</div>
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#custom-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- YOU LOGO HERE -->
<a class="navbar-brand" href="index.html">
<!-- IMAGE OR SIMPLE TEXT -->
<img class="dark-logo" src="assets/images/top_logo_3.png" width="220" alt="">
</a>
</div>
<div class="collapse navbar-collapse" id="custom-collapse">
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
Home
<ul class="dropdown-menu" role="menu">
<li class="dropdown">
Multi Page
<ul class="dropdown-menu">
<li>Parallax</li>
<li>Film overlay</li>
<li>Slider</li>
<li>Text rotator</li>
<li>Youtube background</li>
</ul>
</li>
<li class="dropdown">
One page
<ul class="dropdown-menu">
<li>Parallax</li>
<li>Film overlay</li>
<li>Slider</li>
<li>Text rotator</li>
<li>Youtube background</li>
</ul>
</li>
</ul>
</li>
<li class="dropdown">
Pages
<ul class="dropdown-menu" role="menu">
<li class="dropdown">
About
<ul class="dropdown-menu">
<li>About 1</li>
<li>About 2</li>
</ul>
</li>
<li class="dropdown">
Services
<ul class="dropdown-menu">
<li>Services 1</li>
<li>Services 2</li>
</ul>
</li>
<li class="dropdown">
Contact
<ul class="dropdown-menu">
<li>Contact 1</li>
<li>Contact 2</li>
</ul>
</li>
<li class="dropdown">
Pricing
<ul class="dropdown-menu">
<li>Pricing 1</li>
<li>Pricing 2</li>
</ul>
</li>
<li>Login / Register</li>
<li>FAQ</li>
</ul>
</li>
<li class="dropdown">
Features
<ul class="dropdown-menu" role="menu">
<li>Buttons</li>
<li>Icons</li>
<li>Content boxes</li>
<li>Typography</li>
<li>Progress bars</li>
<li>Tab & Accordian</li>
<li>Pricing tables</li>
<li>Modules & Overlays</li>
</ul>
</li>
<li>Contact</li>
</ul>
</div>
</div>
</nav>
<!-- /NAVIGATION -->
Is this what you want?
Put this code:
#media only screen and (max-width: 992px){
.navbar-header {
margin: 0 auto;
text-align: center;
width: 50%;
}
.navbar-brand {
display: inline-block;
}
img.dark-logo {
text-align: center;
}
div#custom-collapse {
margin: 0 auto;
width: 50%;
}
.nav .navbar-nav .navbar-right {
width: 50%;
margin: 0 auto;
}
}
I want to add a border to my tab content. There should be no border at the bottom of the selected tab. I found this questions: how to give a border to bootstrap tab contents, but the answers didn't work for me?
HTML:
<ul class="nav nav-tabs pull-right">
<li><a data-toggle="tab" href="#sub_cats_8">תתי קטגוריות</a></li>
<li class="active"><a data-toggle="tab" href="#category_8">קטגוריה</a></li>
</ul>
<div class="clearfix"></div>
<div class="tab-content" style="height: 100%;">
<div id="category_8" class="tab-pane fade in active category" style="background-image: url('example.jpg');">
<h1> קוסמטיקה </h1>
</div>
<div id="sub_cats_8" class="tab-pane fade">
<ul class="sub_categories">
<li>איפור</li>
</ul>
</div>
</div>
CSS:
body, html {
direction: rtl;
height: 100%;
font-family: Tahoma;
}
.nav-tabs {
direction: ltr;
}
#logo {
background-color: #005CB8;
width: 100%;
color: white;
padding: 4% 10%;
-webkit-box-shadow: 20px 10px 20px #003972;
-moz-box-shadow: 20px 10px 20px #003972;
box-shadow: 20px 10px 20px #003972;
border-bottom-left-radius: 50px;
}
#logo h1, #logo h4 {
display: inline;
font-family: head;
}
#logo h1 {
font-size: 550%;
}
#logo h4 {
font-size: 220%;
}
.navbar-inverse {
background-color: #477199;
font-weight: bold;
}
.nav.navbar-nav.navbar-right li a {
color: white;
}
.nav.navbar-nav li a {
color: white;
}
.navbar-inverse .navbar-nav > .active {
background-color: #003972;
}
.navbar-inverse .navbar-nav > .active > a, .navbar-inverse .navbar-nav > .active > a:hover, .navbar-inverse .navbar-nav > .active > a:focus {
color: white;
background: #003972;
}
.navbar-inverse .navbar-nav > li > a:hover, .navbar-inverse .navbar-nav > li > a:focus {
background-color: #324F6B;
color: white;
}
.category {
text-align: center;
margin-top: 1px;
background-size: 100% 100%;
padding: 15% 0;
}
.category h1 {
color: white;
font-family: head;
font-size: 500%;
text-shadow: 2px -2px black;
}
.category_start {
margin: 0 auto;
width: 85%;
}
.sub_categories {
-webkit-columns: auto 3;
/* Chrome, Safari, Opera */
-moz-columns: auto 3;
/* Firefox */
columns: auto 3;
list-style-type: disc;
margin-top: 5px;
}
.category_start .container {
margin-top: 10px;
}
.product_image {
height: 80px;
width: 80px;
}
.products_sub_list {
margin: 10px auto 0;
text-align: center;
max-width: 80%;
border-radius: 7px;
}
.products_sub_list td {
width: 15%;
max-width: 15%;
padding: 0 5px;
border: 3px solid #46617A;
}
.product {
width: 80%;
border: 3px solid #46617A;
margin: 0 auto;
text-align: center;
border-radius: 10px;
}
.product_table td {
border: 2px solid #46617A;
padding: 13px;
}
.product_table {
display: inline-table;
margin-left: 15px;
margin-bottom: 8px;
}
.product_table td:first-child {
font-weight: bold;
}
.page {
width: 85%;
margin: 0 auto;
padding: 15px 25px;
border: 2px solid #46617A;
border-radius: 10px;
background-color: #C8D0D7;
}
.register {
margin: 0 auto;
width: 80%;
text-align: center;
}
.register td {
padding: 5px;
text-align: right;
}
.register table {
margin-right: 240px;
}
#register {
width: 80%;
position: absolute;
z-index: 2;
display: none;
left: 0;
right: 0;
top: 100px;
margin: 0 auto;
border: 3px solid #0066FF;
background-color: #CCE0FF;
text-align:center;
border-radius: 10px;
}
#bbg {
display: none;
position: absolute;
z-index: 1;
top: 0;
left: 0;
height: 100%;
width: 100%;
background-color: black;
opacity: 0.8;
filter: alpha(opacity=80);
}
.tab-content {
border: 1px solid #ddd;
padding: 1px;
}
JSFiddle: http://jsfiddle.net/ep2drocb/7/
Notice there is border in the open tab, also the closed tabs have a double border.
The main problem is the pull-right on the ul element.
Remove pull-right class from the ul
Remove the clear-fix element as it's not needed anymore
Remove top border from your tab-content class
Float the lis right
Correct the margins on the tab anchors
Relevant HTML:
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#category_8">תתי קטגוריות</a></li>
<li><a data-toggle="tab" href="#sub_cats_8">קטגוריה</a></li>
</ul>
<div class="tab-content">
<div id="category_8" class="tab-pane fade in active category">
<h1> קוסמטיקה </h1>
</div>
<div id="sub_cats_8" class="tab-pane fade">
<ul class="sub_categories">
<li>איפור</li>
</ul>
</div>
</div>
Relevant CSS:
.tab-content {
border: 1px solid #ddd;
border-width: 0 1px 1px; /* Removes the top border */
padding: 1px;
}
.nav-tabs > li {
float: right;
}
.nav-tabs > li > a {
margin-right: 0;
margin-left: 2px;
}
JSFiddle: http://jsfiddle.net/ep2drocb/9/
That should get you on the right track.
Hello i have the following live example http://jsfiddle.net/vfubN/4/ where you can see a navigation in action if you check out docs you will see that the submenu isn't working right. Can someone help me out fixing it ? Seems that i can't see the solution even if it's in front of my eyes.
HTML
<header role="banner">
<div class="navbar fixed-top navbar-theme-aizio-background">
<div class="inner-navbar"> Test<sub>name</sub>
<div class="container">
<nav id="menu" class="nav" role="navigation">
<ul class="inactive-responsive" id="inactive-responsive">
<li>
<span><i aria-hidden="true" class="icon-home"></i></span>Home
</li>
<li class="inactive-dropdown" id="dropdownToggle"> <span><i aria-hidden="true" class="icon-signal"></i></span>Docs
<ul class="inactive-dropdown vertical-navigation" id="inactive-dropdown">
<li> <span><i aria-hidden="true" class="icon-code"></i></span>ssss
</li>
<li> <span><i aria-hidden="true" class="icon-qrcode"></i></span>Portfolio
</li>
<li> <span><i aria-hidden="true" class="icon-print"></i></span>Blog
</li>
<li> <span><i aria-hidden="true" class="icon-heart"></i></span>The team
</li>
<li><span><i aria-hidden="true" class="icon-envelope"></span></i>google.ro
</li>
</ul>
</li>
<li><span><i aria-hidden="true" class="icon-cog"></i></span>Portfolio
</li>
<li><span><i aria-hidden="true" class="icon-cloud"></i></span>Blog
</li>
<li><span><i aria-hidden="true" class="icon-heart"></i></span>The team
</li>
<li><span><i aria-hidden="true" class="icon-envelope"></span></i>Contact
</li>
</ul>
</nav>
</div>
</div>
</div>
</header>
CSS
.navbar [class^="icon-"],
[class*=" icon-"] {
display: block;
font-size: 32px;
font-size: 2rem;
vertical-align: middle;
background-repeat: no-repeat;
}
.navbar {
background: #4d4d4d;
width: 100%;
-webkit-box-shadow: 0 0 0.9em #555555;
box-shadow: 0 0 0.9em #555555;
}
.navbar-inner {
width: 100%;
}
/*
Navbar Brand Styles
*/
.inner-navbar .brand {
color: #ffffff;
font-size: 32px;
font-size: 2rem;
line-height: 1.5;
padding-right: 24px;
padding-right: 1.5rem;
display: block;
font-family: "Gill Sans", "Gill Sans MT", Calibri, sans-serif;
}
.inner-navbar .brand sub,
sup {
padding-left: 5px;
padding-left: 0.3rem;
font-size: 14px;
font-size: 0.9rem;
}
.inner-navbar .brand:hover {
color: #004b67 /*#383838 */;
text-decoration: none;
}
.inner-navbar nav {
display: block;
font-size: 14px;
font-size: 0.9rem;
font-family: Arial, sans-serif;
z-index: 1000;
}
.inner-navbar nav button#responsiveToggle {
display: none;
}
.inner-navbar nav ul {
padding: 0;
margin: 0 auto;
text-align: center;
}
.inner-navbar nav ul li {
display: block;
float: left;
width: auto;
min-width: 130px;
min-width: 8.1rem;
}
.inner-navbar nav li:first-child a,
li:last-child a {
border-left: 0;
}
.inner-navbar nav ul li a {
display: block;
text-align: center;
text-decoration: none;
line-height: 1.5;
}
.inner-navbar nav a:hover {
color: #004b67;
}
.inactive-dropdown {
display: none;
}
.active-dropdown {
position: absolute;
background-color: #1f2024;
-webkit-border-radius: 0 0 5px 5px;
-moz-border-radius: 0 0 5px 5px;
border-radius: 0 0 5px 5px;
}
.active-dropdown li {
float: left;
clear: both;
line-height: 1.5;
vertical-align: middle;
/* nice blue color background-color: #2aa4cf; */
}
.active-dropdown li a {
display: block;
width: auto;
text-align: left;
line-height: 1.5;
}
.vertical-navigation {
float: none;
}
.vertical-navigation i {
float: left;
line-height: 1.5;
}
/*
Themes
*/
.navbar-theme-blue-marina {
background: #2aa4cf;
}
.navbar-theme-aizio-background,
.active-dropdown li {
background: #004b67;
}
.navbar-theme-aizio-background a {
color: #fff;
}
.navbar-theme-aizio-background ul li a:hover {
color: #b2e558;
}
.navbar-theme-aizio-background .brand:hover {
color: #b2e558;
}
/* ------------------------------ RESPONSIVE STYLES ----------------------------------------------------*/
/*Styles for screen 768px and lower*/
#media screen and (max-width: 768px) {
.active-dropdown {
position: relative;
display: block;
}
.active-dropdown li a {
text-align: center;
}
.inner-navbar nav li {
width: 50%;
float: left;
position: relative;
border-left: 0 solid #666;
}
.inner-navbar nav li a {
border-left: 0;
padding: 10px 0;
background: #383838;
}
.inner-navbar nav li a:hover {
background: #636363;
}
.inner-navbar nav a {
text-align: center;
width: 100%;
}
}
/*Styles for screen 515px and lower*/
#media only screen and (max-width: 480px) {
.inner-navbar nav {
border-bottom: 0;
}
.inner-navbar nav li {
width: 100%;
float: none;
position: relative;
border-left: 0 solid #666;
}
.inner-navbar nav li a {
border-bottom: 1px solid #0c0a0d;
}
.inner-navbar nav button#responsiveToggle {
display: block;
width: 100%;
}
.inner-navbar nav button#responsiveToggle {
zoom: 1;
}
.inner-navbar nav button#responsiveToggle:before {
content: '';
/* 1 */
display: block;
/* 2 */
}
.inner-navbar nav button#responsiveToggle:after {
content: '';
display: table;
clear: both;
}
/* When JavaScript is enabled, we hide the menu */
.js .inner-navbar nav .inactive-responsive {
display: none;
}
/* Displaying the menu when the user has clicked on the button */
.active-responsive a:hover {
font-size: 2em;
opacity: .5;
}
.active-responsive a:hover i {
display: none;
}
.fixed-top {
position: relative;
}
}
/*Smartphone*/
#media only screen and (max-width: 320px) {
.active-dropdown li {
display: block;
float: none;
width: 100%;
}
.inner-navbar nav li {
display: block;
float: none;
width: 100%;
}
.inner-navbar nav li a {
border-bottom: 1px solid #0c0a0d;
}
}
/* RETINA */
/* ------------------------------ RESPONSIVE STYLES ----------------------------------------------------*/
/*Styles for screen 768px and lower*/
#media screen and (max-width: 768px) {
.inner-navbar .brand {
display: none;
}
}
/*Styles for screen 515px and lower*/
/*Smartphone*/
#media only screen and (max-width: 320px) {
.inner-navbar .brand {
display: block;
}
.inner-navbar .pull-left {
float: none;
}
.inner-navbar .pull-right {
float: none;
}
}
/* RETINA */
You have a few problems because styles for the horizontal menu are affecting the vertical one, i made this changes in your CSS:
.inner-navbar nav .vertical-navigation li a{
text-align:left;
}
.vertical-navigation i {
float:none;
line-height: 1.5;
}
.vertical-navigation li [class^="icon-"] {
display: inline-block;
padding: 0 10px;
}
View the demo http://jsfiddle.net/vfubN/13/
I have the same menu and it works. I give you the CSS. You still have more for you to rename.
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Index</title>
<style type="text/css">
#menu, #menu ul {
padding:0;
margin:0;
list-style: none;
}
#menu li {
display:inline-block;
width:150px;
text-align: center;
background: #999;
}
#menu ul {
position:absolute;
left:-999em;
}
#menu li:hover ul {
left:auto;
}
#menu a {
display:block;
}
</style>
</head>
<body>
<ul id="menu">
<li id='accueil'>accueil</li><!--
--><li><a href="" class='catalogue'>CATALOGUE</a></li><!--
--><li><a class='fonction' href="">FONCTIONNEMENT</a>
<ul>
<li><a href='toto'>toto</a></li><!--
--><li><a href='toto'>tutu</a></li><!--
--><li><a href='toto'>titi</a></li><!--
--><li><a href='toto'>tata</a></li>
</ul>
</li><!--
--><li><a class='service' href="">LES SERVICES</a></li><!--
--><li><a class='commande' href="">COMMANDE</a></li><!--
--><li><a class='contact' href="">CONTACT</a></li>
</ul>
</body>
</html>
I want to design two menu bar on same page first gray and second blue
Now I have developed the blue toolbar which is working fine
with following code below but now the problem is, i cannot use this (.navbar .nav > li > a) and similar classes for both menu bars because of the color and size. The main problem is i have to centered align the text with the width of website block. When i zoom by pressing control + mouse scroll gray bar should be centered align Any Idea how to fix this????
<style type="text/css">
li a
{
font-size: 15pt;
}
.nav
{
min-width: 850px;
}
.navbar
{
margin-bottom: 0;
overflow: visible;
}
.navbar .nav
{
margin: -10px 10px 0 0;
}
.nav-collapse, .nav-collapse.collapse
{
overflow: hidden;
}
.nav-collapse .nav > li > a:hover, .nav-collapse .nav > li > a:focus, .nav-collapse .dropdown-menu a:hover, .nav-collapse .dropdown-menu a:focus
{
background-color: #004a8f;
color: #fff;
}
.navbar-inner
{
background-image: none;
color: #FFFFFF;
background-color: #1276bc;
min-height: 40px;
padding-left: 10px;
padding-right: 20px;
text-align: center;
border-right: 1px solid black;
}
.navbar .nav > .active > a, .navbar .nav > .active > a:hover, .navbar .nav > .active > a:focus
{
font-weight: bold;
color: #FFFFFF;
background-color: #004a8f;
-webkit-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125);
-moz-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125);
box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125);
}
.navbar .nav > li > a
{
font-weight: bold;
color: #FFFFFF;
float: none;
line-height: 19px;
padding: 17px 21px 0 15px;
text-decoration: none;
text-shadow: none;
height: 30px;
width: 116px;
border-right: 1px solid #6992cc;
}
.navbar .nav > li > a:hover
{
font-weight: bold;
color: #FFFFFF;
text-shadow: none;
float: none;
line-height: 19px;
padding: 17px 21px 0 15px;
text-decoration: none;
background-color: #004a8f;
height: 30px;
width: 116px;
}
.navbar-inner-TopPanel
{
background-color: transparent;
background-repeat: repeat-x;
height: 30px;
padding-top: 15px;
}
.navbar-inner-BottomPanel
{
background-color: #1276bc;
background-repeat: repeat-x;
max-width: 760px;
padding-left: 8px;
}
ul, ol
{
/* padding-left:18%;
padding-top:5px;
padding-bottom:5px;
padding-right:5px;*/
}
.lock
{
/* text-decoration: none;*/
color: gray;
font-weight: normal;
text-shadow: none;
}
.Unlock
{
color: #1276BC;
font-weight: bolder; /*text-shadow: 0 3px 10px rgba(0, 0, 0, 0.39);*/
}
</style>
<div class="row-fluid">
<div>
<div class="navbar">
<div class="navbar-inner">
<div class="container navbar-inner-BottomPanel">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span
class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span>
</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li><a href="Default.aspx">
<img id="Img1" style="margin-top: -15px; height: 25px;" runat="server" src="../images/logoheader.png"
alt="Home" /></a> </li>
<li>Play </li>
<li>Teams </li>
<li>About Us </li>
<li>Contact Us </li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
to center your website, you can do this :
<style>
.container
{
width: 1000px; /* set the width that's you want */
margin: 0 auto;
}
</style>
and under your div .row-fluid :
<div class="Greygradiant" style="width: 100%">
<div class="row-fluid">...</div>
<div class="container">
<!-- your content -->
</div>
</div>
Hope it's help !