I have a sidebar that is fixed with a height of 100%. This sidebar is below a fixed header so the top is below the header.
This causes the overflow scrolling to not reach the last element or two:
JSFiddle
Here is the HTML:
<div class="header">
<div class="header-inner">
<h1 class="header-image"><img src="/" id="logo" alt="Header Test"/></h1>
<nav class="menu">
<ul class="nav-lvl-1">
<li>Home</li>
<li>Link1 </li>
<li><a class="has-sub-menu" href="http://google.com/nav">Link2</a>
<ul id="test" class="nav-lvl-2">
<li>Sublink1</li>
<li>Sublink2</li>
<li>Sublink3</li>
<li>Sublink4</li>
<li>Sublink5</li>
<li>Sublink6</li>
<li>Sublink7</li>
<li>Sublink8</li>
<li>Sublink9</li>
<li>Sublink10</li>
<li>Sublink11</li>
<li>Sublink12</li>
</ul>
</li>
<li>Link3</li>
<li><a class="has-sub-menu" href="http://google.com/nav">Link4</a>
<ul class="nav-lvl-2">
<li>Sublink1</li>
<li>Sublink2</li>
<li>Sublink3</li>
<li>Sublink4</li>
<li>Sublink5</li>
</ul>
</li>
<li><a class="has-sub-menu" href="http://google.com/nav">Link6</a>
<ul class="nav-lvl-2">
<li>Sublink1</li>
<li>Sublink2</li>
</ul>
</li>
</ul>
</nav>
</div>
</div>
And CSS:
.header {
position: fixed;
top: 0;
left: 0;
width: 100%;
background: #6ab014;
z-index: 100001;
height: 75px;
overflow: hidden;
-webkit-transition: height 0.3s;
-moz-transition: height 0.3s;
transition: height 0.3s;
}
/********* Disable link to open sub-menu **********/
.header .header-image a {
pointer-events: none;
cursor: pointer;
}
/* Stop header from overlapping container */
.container {
position: relative;
margin-top: 75px;
width: 100%;
}
.main {
position: block;
width: 90%;
max-width: 80em;
margin: 0 auto;
padding: 0 1.875em;
}
/********* Side Menu **********/
.header nav {
position: fixed;
left: 0px;
top: 75px;
background: #87cc33;
width: 330px;
height: 100%;
z-index: 1000;
overflow:auto;
/* Transitions */
-webkit-transition: all 0.3s ease;
-moz-transition: all 0.3s ease;
transition: all 0.3s ease;
}
.header nav ul
{
padding: 0;
margin: 0;
list-style-type: none;
}
/* Open menu CSS */
.menu.menu-open {
left: 0px;
}
/********* Navigation Sub-menus **********/
.menu .nav-lvl-2.sub-menu-open-mobile{
/* Max-height may have to change with more sublinks */
max-height: 1000px;
display: block;
opacity: 1;
}
.menu .nav-lvl-2 {
background: #a5e25b;
max-height: 0px;
display: none;
opacity: 0;
/* Transitions */
-webkit-transition: all .3s ease;
-moz-transition: all .3s ease;
transition: all .3s ease;
}
.menu .nav-lvl-2 a {
border-bottom: 1px solid #fff;
}
/********* Disable links to open sub-menu **********/
.has-sub-menu {
pointer-events: none;
cursor: pointer;
}
.menu li:hover {
cursor: pointer;
}
/********* Link CSS **********/
.menu a{
display: block;
color: #fff;
font-size: 1.1em;
font-weight: 300;
border-bottom: 1px solid #a5e25b;
padding: 1em;
text-decoration: none;
}
/******* Mobile dropdown arrow - down *********/
a.has-sub-menu:not(.sub-menu-open-mobile):before {
position: absolute;
content: "";
left: 290px;
width: 0;
height: 0;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-top: 11px solid #fff;
margin-top: 7px;
}
/******* Mobile dropdown arrow - up *********/
a.has-sub-menu.sub-menu-open-mobile:before {
position: absolute;
content: "";
left: 290px;
width: 0;
height: 0;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-bottom: 11px solid #fff;
margin-top: 7px;
}
/******* dropdown link css *********/
a.has-sub-menu:hover:before,
a.has-sub-menu:focus:before,
a.has-sub-menu:active:before {
border-color: transparent #730800;
}
a.has-sub-menu:hover:after,
a.has-sub-menu:focus:after,
a.has-sub-menu:active:after {
border-color: #730800;
}
Is there a way to solve this using CSS and not JQuery/Javascript?
How about using bottom: 0 instead of using height: 100%. Using height: 100% plus a top value will push it off the page.
Updated .header nav (JSFiddle)
.header nav {
position: fixed;
left: 0px;
top: 75px;
background: #87cc33;
width: 330px;
bottom: 0;
z-index: 1000;
overflow:auto;
/* Transitions */
-webkit-transition: all 0.3s ease;
-moz-transition: all 0.3s ease;
transition: all 0.3s ease;
}
Alternately, you could use height with calc.
height: calc(100% - 75px);
But the browser support is not as good with this option.
Related
Hey all have this menu which i wish to have toggle on click X and again back to hamburger style.
could someone help me out here? I just have no clue how that is achieved. sharing my menu codes here. hope some expert could help me out.
here are my menu codes
$(document).ready(function() {
$('#menulink').click(function(event) {
event.preventDefault();
if($('.navigation-wrapper').hasClass('show-menu')) {
$('.navigation-wrapper').removeClass('show-menu');
$('.navigation').hide();
$('.navigation li').removeClass('small-padding');
} else {
$('.navigation-wrapper').addClass('show-menu');
$('.navigation').fadeIn();
$('.navigation li').addClass('small-padding');
}
});
});
.hamburger-wrapper {
padding: 0;
background: #000;
position: fixed;
top: 40px;
left:90px;
width: 50px;
z-index: 999;
}
.inner-hamburger-wrapper {
background: #ca1404;
width: 100%;
padding: 8px 0;
}
.hamburger {
width: 50%;
height: 3px;
margin: 4px auto;
background: #fff;
border-radius: 2px;
}
.menu-title {
position: absolute;
top: 10px;
right: 0;
width: 50%;
}
.menu-title p {
color: #fff;
font-size: 18px;
line-height: 22px;
text-align: center;
}
.navigation-wrapper {
background: linear-gradient(180deg, #C7100C 0%, #3F5EFB 100%);
padding: 40px 0 0 0;
position: fixed;
top: 0;
left: 0;
height: 100%;
width: 100%;
z-index: 900;
display: none;
}
.navigation {
padding: 50px 5% 0 5%;
display: none;
}
.show-menu {
display: block;
}
.navigation li {
list-style: none;
margin: 50px 0;
transition: all ease .6s;
} .navigation li.small-padding {
margin: 0;
}
.navigation li a {
display: block;
padding: 10px 0 10px 1%;
color: #fff !important;
text-decoration: none;
font-size: 150%;
letter-spacing: .1em;
border-left: 3px solid #000;
-moz-transition: all ease .3s;
-webkit-transition: all ease .3s;
-ms-transition: all ease .3s;
-o-transition: all ease .3s;
transition: all ease .3s;
}
.navigation li a:hover {
color: #fff;
padding-left: 2%;
border-left: 3px solid #eee;
}
#media (min-width: 320px) and (max-width: 768px) {
.hamburger-wrapper {
padding: 0;
background: #000;
position: fixed;
top: 30px;
left:5px;
width: 50px;
z-index: 999;
}
.navigation li a {
display: block;
padding: 10px 0 10px 1%;
color: #bbb;
text-decoration: none;
font-size: 90%;
letter-spacing: .1em;
border-left: 3px solid #000;
-moz-transition: all ease .3s;
-webkit-transition: all ease .3s;
-ms-transition: all ease .3s;
-o-transition: all ease .3s;
transition: all ease .3s;
border-bottom: 1px solid rgba(255, 255,
}
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<a id="menulink" href="#">
<div class="hamburger-wrapper">
<div class="inner-hamburger-wrapper">
<div class="hamburger"></div>
<div class="hamburger"></div>
<div class="hamburger"></div>
</div>
</div>
</a>
<div class="navigation-wrapper">
<ul class="navigation">
<li>Home</li>
<li>Website Design</li>
<li>Search Engine Optimization</li>
<li>User Experience</li>
<li>AB Testing</li>
<li>Contact</li>
</ul>
</div>
would appreciate your kind help.
Thanks in advance
You should do the following things:
add a class like 'active' to the hamburger button when active (Jquery > toggleClass)
the three lines in the button can be animated seperately by making classes for each of them : #menulink.active .hamburger-wrapper .inner-hamburger-wrapper div:nth-of-type(1){}
have transitions and rotation on each .hamburger element : 2 make a cross, 1 disappears.
I am trying to make a website. I decided to make the navigation bar have a fixed position so when I scroll down I can always see it but, when I add to the nav element the property position:fixed it just disappears. Cant' figure out what's happening. Can someone explain, what I'm doing wrong? Thank you very much!
P.S: I am new to coding.
HTML and CSS
* {
box-sizing: border-box;
padding: 0;
margin: 0;
}
html,
body {
width: 100%;
height: 100%;
}
header nav #logo {
width: 140px;
position: absolute;
top: 15px;
}
nav {
position: relative;
background-color: #242628;
height: 70px;
padding-left: 20px;
}
nav ul {
position: absolute;
height: 100%;
margin: auto;
top: 0;
bottom: 0;
width: 600px;
padding-left: 200px;
}
nav ul li {
-moz-transition: all 0.2s linear;
-webkit-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
transition: all 0.2s linear;
display: inline;
float: left;
height: inherit;
width: 100px;
border-right: 1px solid gray;
}
nav ul li:hover {
background-color: rgba(12, 240, 255, 0.3);
}
nav ul li a {
color: white;
text-decoration: none;
position: absolute;
height: inherit;
width: inherit;
text-align: center;
padding-top: 25px;
}
<header>
<nav>
<img id="logo" src="images/logo.png" alt="logo" />
<ul>
<li>Home</li>
<li>Rate it!</li>
<li>Courses</li>
<li>Videos</li>
</ul>
</nav>
</header>
Once you fix the position you have to specify where you want it.
top: 20px;
left: 0px;
Etc....
You have to add a width to fixed elements (100% in this case):
* {
box-sizing: border-box;
padding: 0;
margin: 0;
}
html,
body {
width: 100%;
height: 100%;
}
header nav #logo {
width: 140px;
position: absolute;
top: 15px;
}
nav {
position: fixed;
width: 100%;
background-color: #242628;
height: 70px;
padding-left: 20px;
}
nav ul {
position: absolute;
height: 100%;
margin: auto;
top: 0;
bottom: 0;
width: 600px;
padding-left: 200px;
}
nav ul li {
-moz-transition: all 0.2s linear;
-webkit-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
transition: all 0.2s linear;
display: inline;
float: left;
height: inherit;
width: 100px;
border-right: 1px solid gray;
}
nav ul li:hover {
background-color: rgba(12, 240, 255, 0.3);
}
nav ul li a {
color: white;
text-decoration: none;
position: absolute;
height: inherit;
width: inherit;
text-align: center;
padding-top: 25px;
}
<header>
<nav>
<img id="logo" src="images/logo.png" alt="logo" />
<ul>
<li>Home</li>
<li>Rate it!</li>
<li>Courses</li>
<li>Videos</li>
</ul>
</nav>
</header>
I let you here a working version. I only replaced relative with fixed in your code to the nav
* {
box-sizing: border-box;
padding: 0;
margin: 0;
}
html,
body {
width: 100%;
height: 300%;
}
header nav #logo {
width: 140px;
position: absolute;
top: 15px;
}
nav {
position: fixed;
background-color: #242628;
height: 70px;
padding-left: 20px;
}
nav ul {
position: absolute;
height: 100%;
margin: auto;
top: 0;
bottom: 0;
width: 600px;
padding-left: 200px;
}
nav ul li {
-moz-transition: all 0.2s linear;
-webkit-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
transition: all 0.2s linear;
display: inline;
float: left;
height: inherit;
width: 100px;
border-right: 1px solid gray;
}
nav ul li:hover {
background-color: rgba(12, 240, 255, 0.3);
}
nav ul li a {
color: white;
text-decoration: none;
position: absolute;
height: inherit;
width: inherit;
text-align: center;
padding-top: 25px;
}
<header>
<nav>
<img id="logo" src="images/logo.png" alt="logo" />
<ul>
<li>Home</li>
<li>Rate it!</li>
<li>Courses</li>
<li>Videos</li>
</ul>
</nav>
</header>
Note that I set height to 300% to have some scroll on the document
I honestly don't see anything wrong:
http://codepen.io/anon/pen/BWpLdd
.scrollTest {
height: 2000px;
background: -moz-linear-gradient(top, #a90329 0%, #8f0222 44%, #6d0019 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(top, #a90329 0%,#8f0222 44%,#6d0019 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, #a90329 0%,#8f0222 44%,#6d0019 100%);
}
* {
box-sizing: border-box;
padding: 0;
margin: 0; }
html, body {
width: 100%;
height: 100%; }
header nav #logo {
width: 140px;
position: absolute;
top: 15px; }
nav {
position: fixed;
background-color: #242628;
height: 70px;
padding-left: 20px;
width: 100%;
}
nav ul {
position: absolute;
height: 100%;
margin: auto;
top: 0;
bottom: 0;
width: 800px;
padding-left: 200px; }
nav ul li {
-moz-transition: all 0.2s linear;
-webkit-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
transition: all 0.2s linear;
display: inline-block;
height: inherit;
width: 100px;
border-right: 1px solid gray; }
nav ul li:hover {
background-color: rgba(12, 240, 255, 0.3); }
nav ul li a {
color: white;
text-decoration: none;
position: absolute;
height: inherit;
width: inherit;
text-align: center;
padding-top: 25px; }
Make sure you're adding it to the nav parent element.
* {
box-sizing: border-box;
padding: 0;
margin: 0;
}
html,
body {
width: 100%;
height: 100%;
}
header nav #logo {
width: 140px;
position: absolute;
top: 15px;
}
nav {
position: fixed;
background-color: #242628;
height: 70px;
padding-left: 20px;
width: 100%;
background-color: black;
}
nav ul {
position: relative;
height: 100%;
margin: auto;
top: 0;
bottom: 0;
}
nav ul li {
-moz-transition: all 0.2s linear;
-webkit-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
transition: all 0.2s linear;
display: inline;
float: left;
height: inherit;
width: 200px;
border-right: 1px solid gray;
}
nav ul li:hover {
background-color: rgba(12, 240, 255, 0.3);
}
nav ul li a {
color: white;
text-decoration: none;
position: absolute;
height: inherit;
width: inherit;
text-align: center;
padding-top: 25px;
}
article{
height: 500px;
}
<header>
<nav>
<img id="logo" src="" alt="logo" />
<ul>
<li>Home</li>
<li>Rate it!</li>
<li>Courses</li>
<li>Videos</li>
</ul>
</nav>
</header>
<article></article>
Working code
If your nav is set to realtive and is changed to fixed your absolute elements will be relative to the body and those elements will leave the nav.
Change the position of the absolute elements and the css of the nav to:
nav {
background-color: #242628;
height: 70px;
padding-left: 20px; }
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 999;
}
My question is rather simple,
text-decoration:none - is not working in this example when a user hovers over an <a> tag. Where is my mistake?
I have provided the whole project to help you understand what I'm trying to achieve. There is a code snippet below that displays my code with the current problem.
Thanks in advance guys.
* {
font-family: "Helvetica Neue";
font-size: 22px;
text-decortion:none!important
}
.container {
color: #a2abbd;
width: 100%;
height: 100%;
background-color: #21212b;
}
.radio-container {
overflow: hidden;
position: relative;
margin: 7% auto;
height: 504px;
width: 320px;
background-color: #2c2c37;
border-top: 1px solid #f1be81;
-webkit-border-radius: 25px;
-moz-border-radius: 25px;
-ms-border-radius: 25px;
border-radius: 25px;
-webkit-box-shadow: 0px 50px 151px -36px rgba(0, 0, 0, 0.75);
-moz-box-shadow: 0px 50px 151px -36px rgba(0, 0, 0, 0.75);
box-shadow: 0px 50px 151px -36px rgba(0, 0, 0, 0.75);
}
header {
text-align: center;
vertical-align: middle;
line-height: 79px;
height: 79px;
background-color: #edae61;
color: white;
font-weight: bold;
}
header a {
display: block;
position: absolute;
width: 60px;
height: 80px;
}
header .arrow {
left: 0;
top: 0;
}
header .arrow img {
margin-bottom: 5px;
}
header .on-off {
right: 0;
top: 0;
}
header .on-off img {
margin-bottom: 10px;
margin-right: 7px;
}
section {
-webkit-transition: all 500ms ease;
-moz-transition: all 500ms ease;
-ms-transition: all 500ms ease;
-o-transition: all 500ms ease;
transition: all 500ms ease;
}
section ul {
position: relative;
padding: 0;
margin: 11px 23px 0px 23px;
line-height: 1.364;
}
section ul li {
border-bottom: 1px solid #40404a;
list-style-type: none;
overflow: hidden;
}
section ul li:last-child {
border: none;
}
section ul li a {
display: block;
padding: 18px 0px 14px 0px;
cursor: pointer;
width: 100%;
height: 100%;
color: #a2abbd;
text-decoration: none;
}
section ul li a:hover p {
color: #848b9b;
}
section ul li a p {
display: inline;
}
section ul li a p strong {
float: right;
clear: both;
}
section ul li a p img {
padding-right: 0.5em;
padding-bottom: 0.2em;
}
section ul .dribbleFM {
position: relative;
-webkit-transition: all 500ms ease;
-moz-transition: all 500ms ease;
-ms-transition: all 500ms ease;
-o-transition: all 500ms ease;
transition: all 500ms ease;
}
section ul .dribbleFM .dribble-anchor {
position: absolute;
top: -200px;
z-index: 1;
}
section ul .dribbleFM .dribble-anchor:target {
top: 18px;
margin-bottom: 18px;
position: relative;
-webkit-transition: all 500ms ease;
-moz-transition: all 500ms ease;
-ms-transition: all 500ms ease;
-o-transition: all 500ms ease;
transition: all 500ms ease;
}
section ul .dribbleFM .dribble-anchor:target + .dribble-button1 {
display: none;
}
section ul .dribbleFM .dribble-anchor:target ~ .dribble-button2 {
display: block;
}
section ul .dribbleFM .dribble-anchor .volume {
pointer-events: none;
position: relative;
}
section ul .dribbleFM .dribble-anchor .volume a {
position: relative;
display: inline;
pointer-events: auto;
z-index: 100;
}
section ul .dribbleFM .dribble-anchor .volume .img-main {
margin-left: 33px;
margin-right: 33px;
padding-top: 40px;
padding-bottom: 40px;
}
section ul .dribbleFM .dribble-anchor .volume .clickable {
padding-top: 5px;
padding-bottom: 8px;
}
section ul .dribbleFM .dribble-button2 {
display: none;
}
footer {
position: absolute;
bottom: 0;
height: 79px;
width: 100%;
background-color: #22222b;
border-top: 1px solid #4d505c;
text-align: center;
vertical-align: middle;
line-height: 79px;
cursor: default;
}
<html lang="en">
<head>
<title>Page Title</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatibile" content="IE-edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="netguru recruitment task">
<link href="style.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<div class="radio-container">
<header><img src="https://imageshack.com/i/id8QV4sap">
<p>
STATIONS
</p><img src="https://imageshack.com/i/idUebcAVp">
</header>
<section>
<ul>
<li><a href="#">
<p>
Putin FM<strong>66,6</strong>
</p></a></li>
<li class="dribbleFM">
<div id="dribble-anchor-on" class="dribble-anchor">
<div class="volume"><img src="https://imageshack.com/i/exjVsiWzp"><img src="https://imageshack.com/i/ipxUWXkvp"><img src="https://imageshack.com/i/idsjoKxsp"></div>
</div><a href="#dribble-anchor-on" class="dribble-button1">
<p>
Dribbble FM<strong>101,2</strong>
</p></a><a href="#dribble-anchor-off" class="dribble-button2">
<p>
Dribbble FM<strong>101,2 </strong>
</p></a>
</li>
<li><a href="#">
<p>
Doge FM<strong>99,4</strong>
</p></a></li>
<li><a href="#">
<p>
Ballads FM<strong>87,1</strong>
</p></a></li>
<li><a href="#">
<p><img src="http://imageshack.com/a/img661/6406/acyLmg.png">Maximum FM<strong>142,2 </strong></p></a></li>
</ul>
</section>
<footer>
<p>High quality</p>
</footer>
</div>
</div>
</body>
</html>
By defualt, you have already set the text-decoration:none for anchors. But text-decoration is not acting on hover for anchors because you have not specified it for :hover state.
For :hover, Try this,
section ul li a:hover{text-decoration:none}
Hope this help.!
The solution already post should work fine. By the way, why are you keeping your styles first and then the bootstrap styles. You should keep your styles next to the bootstrap styles. Otherwise, whatever you will loose the impact of your styles overridden by bootstrap styles.
I have collapsible sidebar with two tabs in my angularjs page but it is not working scroll is not visible on overflow.Requirement is scroll bar is not visible on sidebar overflow i gave scrollbar height to auto and overflow-y to scroll but not running.Does anyone know how to do this ?
Here is my Code:
CSS
#wrapper {
padding-left: 0;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
/*margin-top: 57px;*/
}
#wrapper.toggled {
padding-left: 250px;
}
#sidebar-wrapper {
z-index: 1000;
position: fixed;
left: 250px;
width: 0;
/* disini agar ketika di kecilkan tidak hilang semua default 0*/
height: auto;
margin-left: -250px;
overflow-y: hidden;
/* overflow-y: auto, changed to Hidden By VIKAS GAYAKWAD */
background: #000;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#wrapper.toggled #sidebar-wrapper {
width: 250px;
}
#page-content-wrapper {
/*width: 100%;*/
position: absolute;
padding: 15px;
}
#wrapper.toggled #page-content-wrapper {
position: absolute;
margin-right: -250px;
}
.fixed-brand {
width: auto;
}
/* Sidebar Styles */
.sidebar-nav {
position: absolute;
height: 100%;
top: 0;
width: 250px;
overflow-y: scroll;
margin: 0;
padding: 0;
list-style: none;
margin-top: 2px;
}
.sidebar-nav li {
text-indent: 15px;
line-height: 40px;
}
.sidebar-nav li a {
display: block;
text-decoration: none;
color: #999999;
}
.sidebar-nav li a:hover {
text-decoration: none;
color: #fff;
background: rgba(255,255,255,0.2);
border-left: red 2px solid;
}
.sidebar-nav li a:active,
.sidebar-nav li a:focus {
text-decoration: none;
}
.sidebar-nav > .sidebar-brand {
height: 65px;
font-size: 18px;
line-height: 60px;
}
.sidebar-nav > .sidebar-brand a {
color: #999999;
}
.sidebar-nav > .sidebar-brand a:hover {
color: #fff;
background: none;
}
.no-margin {
margin: 0;
}
#media(min-width:768px) {
#wrapper {
padding-left: 250px;
}
.fixed-brand {
width: 250px;
}
#wrapper.toggled {
padding-left: 0;
}
#sidebar-wrapper {
width: 250px;
}
#wrapper.toggled #sidebar-wrapper {
width: 250px;
}
#wrapper.toggled-2 #sidebar-wrapper {
width: 50px;
}
#wrapper.toggled-2 #sidebar-wrapper:hover {
width: 250px;
}
#page-content-wrapper {
padding: 20px;
position: relative;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#wrapper.toggled #page-content-wrapper {
position: relative;
margin-right: 0;
padding-left: 250px;
}
#wrapper.toggled-2 #page-content-wrapper {
position: relative;
margin-right: 0;
margin-left: -200px;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
}
.media-body {
height: 100%;
padding: 4px;
/*margin-top: 5px;*/
/*background:green;*/
}
.media.contact-card {
font-size: 11px;
padding: 5px;
border-bottom: 1px solid #3071a9;
/*color: lightcyan;*/
}
.hr {
border-bottom: 1px solid #e1e1e1;
}
/*slider tab end*/
/* Scrollbar */
.scrollbar {
overflow-y: scroll;
height: auto;
}
Html
<tabset justified="true">
<tab heading="CONTACTS">
<div class="tab-content">
<div>
<div class="pull-right">
<a class="" ui-sref=".client"> <i class="glyphicon glyphicon-plus"></i> Add Contact </a>
</div>
<div class="clearfix"></div>
</div>
<div class="scrollbar">
<!--Start SCROLL BAR, Div Added/Edited by VIKAS GAYAKWAD -->
<div class="hr"></div>
<ul class="media-list">
<contact-card data-client="client" ng-repeat="client in clientList"></contact-card>
</ul>
</div>
<!--End SCROLL BAR--->
</div>
</tab>
<tab heading="RECENT">
<div class="tab-content">
<div ng-repeat="client in clientList">
{{client.firstName}} {{client.lastName}}
</div>
</div>
</tab>
</tabset>
The main problem is probbaly that the scrollbar-<div> has no "Visible" contents except for a <hr>.
Because it is empty except for some unsuported (?) HTML tags, it will show up as a short greyed scrollbar (there simply is nothing to scroll through).
Also, when you do not set the height of the scroll-<div>, the scrollbar will be useless as the DIV stretches along with the content.
You didn't set any max-height for the scrollbar to work. And there's no content inside the .scrollbar element.
Your css for .scrollbar should be like this:
.scrollbar {
overflow-y: scroll;
height: auto;
max-height: 400px;
}
For the scrollbar to appear add this:
.media-list {
height: 450px;
}
Note: The latter isn't necessary if you have contents added, this is just to show you that empty div won't show the scrollbar.
Fiddle
I have a horizontal list in which i am placing div's which are hidden until hovered over. To keep the dimensions (the hidden divs are the width of the menu) i am using outline: 2px solid black; , this works in ie and chrome, it outlines the li item but in firefox it outlines the entire ul item including the hidden div.
Does anyone know of a workaround for this or do i have a conflict for firefox outline?
css:
#marketmenu ul li{
display: block;
float: left;
position: relative;
cursor: pointer !important;
z-index: inherit;
font-size: 16px;
padding-top: 2px;
font-weight: bolder;
width: 15%;
height: 40px;
text-align: center;
background: white;
outline: 2px solid black;
}
#marketmenu ul li div {
position: absolute;
display: block;
top: 98%;
width: 600%;
background: #ffffff;
height: 200px;
opacity: 0;
visibility: hidden;
overflow: hidden;
z-index: 9;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
border-radius: 0 0 3px 3px;
-webkit-transition: all .3s ease .15s;
-moz-transition: all .3s ease .15s;
-o-transition: all .3s ease .15s;
-ms-transition: all .3s ease .15s;
transition: all .3s ease .15s;
}
html:
<div class="mheader-container">
<div id="logo" class="clearfix">
<img src="...">
</div>
<div class="userstatus">
<span class="icon-user-add"></span> Create an account
<span class="icon-user"></span> Log in
</div>
</div>
<div id="market_navigation" class="market_navigation clearfix">
<div id="marketmenu">
<ul>
<li>one<div class="menudrop"></div></li>
<li>two<div class="menudrop"></div></li>
<li>three<div class="menudrop"></div></li>
<li>four<div class="menudrop"></div></li>
<li>five<div class="menudrop"></div></li>
<li>six<div class="menudrop"></div></li>
</ul>
</div>
</div>
jsfiddle (remember its only in firefox there is a issue, renders fine in ie/chrome)
http://jsfiddle.net/ww2rkexd/1/
On the last li item, add a class of "last":
<ul>
<li>one<div class="menudrop"></div></li>
<li>two<div class="menudrop"></div></li>
<li>three<div class="menudrop"></div></li>
<li>four<div class="menudrop"></div></li>
<li>five<div class="menudrop"></div></li>
<li class="last">six<div class="menudrop"></div></li>
</ul>
Then change the CSS for the menudrop class from outline to border:
#marketmenu ul li{
display: block;
float: left;
position: relative;
cursor: pointer !important;
z-index: inherit;
font-size: 16px;
padding-top: 2px;
font-weight: bolder;
width: 15%;
height: 40px;
text-align: center;
background: white;
border-left: 2px solid black;
border-top: 2px solid black;
border-bottom: 2px solid black;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
And add the following CSS for the "last" class
li.last{
border-right: 2px solid black;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
ok this isnt pretty but it works....basically set a background of the border color and then a overlay div with the correct color. The dropdown div remains in proportion to the parent menu.
jsfiddle:
http://jsfiddle.net/dheffernan/pas1fqcp/
HTML
<div id="market_navigation" class="market_navigation clearfix">
<div id="marketmenu">
<ul>
<li><span class="innerli leftish">1st<div class="menudrop"></div></span></li>
<li><span class="innerli">2nd<div class="menudrop"></div></span></li>
<li><span class="innerli">3rd<div class="menudrop"></div></span></li>
<li><span class="innerli">4th<div class="menudrop"></div></span></li>
<li><span class="innerli">5th<div class="menudrop"></div></span></li>
<li><span class="innerli rightish">6th<div class="menudrop last"></div></span></li>
</ul>
</div>
</div>
css
#marketmenu ul{
cursor: pointer;
}
#marketmenu ul li{
display: block;
float: left;
position: relative;
cursor: pointer !important;
z-index: inherit;
font-size: 16px;
padding-top: 2px;
font-weight: bolder;
width: 15%;
height: 40px;
text-align: center;
background: black;
/*
outline: 2px solid black;
*/
}
.innerli{
display: block;
overflow: auto;
height: 88%;
width: 98%;
margin: 1%;
margin-left: 2%;
background-color: white;
padding-top: 6%;
}
.leftish{
margin-left: 2.5%;
}
.rightish{
width: 96%;
}
#marketmenu ul li div {
position: absolute;
display: block;
top: 98%;
width: 596.5%;
background: #ffffff;
height: 200px;
opacity: 0;
background: black;
visibility: hidden;
overflow: hidden;
z-index: 9;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
border-radius: 0 0 3px 3px;
-webkit-transition: all .3s ease .15s;
-moz-transition: all .3s ease .15s;
-o-transition: all .3s ease .15s;
-ms-transition: all .3s ease .15s;
transition: all .3s ease .15s;
}
#marketmenu ul li:first-child div {
}
#marketmenu ul li:nth-child(2) div {
margin-left: -100%;
}
#marketmenu ul li:nth-child(3) div {
margin-left: -200%;
}
#marketmenu ul li:nth-child(4) div {
margin-left: -300%;
}
#marketmenu ul li:nth-child(5) div {
margin-left: -400%;
}
#marketmenu ul li:nth-child(6) div {
margin-left: -500%;
padding-top: 2px;
}
#marketmenu ul li:hover div {
opacity: 1;
visibility: visible;
overflow: visible;
}
.market_navigation{
position: relative;
z-index: 40;
width: 70%;
margin-left: 30%;
height: 40px;
background: white;
}