I have a navigation menu that takes up to 250px in width of the page's left side and 100% in height. I added a 1. Fixed Top Title List Item at the top of the navigation menu, as well as a 2. Fixed Footer List Item at the very bottom of the navigation menu. My idea is to keep both items fixed, and both items have to also disappear when the browser width is a certain size. but I have a big problem:
Problem 1: When I add the fixed width to .topfilter and .bottomfilter, the list items now extend the full width of the
entire page instead of the navigation menu.
Problem 2: Now when I resize the browser the fixed width items
don't disappear
Bonus: I also don't know how to add a padding to the .topfilter and .bottomfilter so that they don't cover up the text before it.
Padding-Top and Padding-Bottom don't work.
Fixed Width Items: https://jsfiddle.net/4fqapznu/1/
.topfilter {border-bottom:solid #333 2px; width:100%; height:40px; position:fixed; display:block; text-align:left; background-color:blue; -moz-box-sizing: border-box;
box-sizing: border-box;}
.bottomfilter {border-top: solid #333 2px; width:100%; height:50px; position:fixed; display:block; text-align:left; background-color:red; -moz-box-sizing: border-box; box-sizing: border-box; bottom:0;}
HTML:
<!-- Sidebar -->
<div id="sidebar-wrapper">
<ul class="sidebar-nav">
<li class="topfilter">
<a class="filtertitle">Title</a>
</li>
<li>
<a href="#/content">
Content
</a>
</li>
<li>
<a href="#/topics">
Topics
</a>
</li>
<li>
<a href="#">
Groups
</a>
</li>
<li>
<a href="#">
Premium
</a>
</li>
<li>
Dashboard
</li>
<li>
Shortcuts
</li>
<li>
Overview
</li>
<li>
Events
</li>
<li>
About
</li>
<li>
Services
</li>
<li>
Contact
</li>
<li class="bottomfilter">
<a class="filtertitle">Footer</a>
</li>
</ul>
</div>
<!-- /#sidebar-wrapper -->
<div class="content" style="min-height:90%; background:white;" >
</div>
<div class="push"></div>
<footer class="footer">
</footer>
CSS:
a {outline:none !important;}
html,
body,
.wrap {
height: 100%;
}
.wrap {
box-sizing: border-box;
}
form {
height: 100%
}
.wrap {
min-height: 100%;
height: auto !important;
height: 100%;
margin-bottom: -60px;
/* for sticky footer to not go below page */
/* for sticky header to not overlap content */
}
.push,
.footer {
height: 60px;
}
.footer {
background-color: #ebebeb;
height: 60px;
width: 100%;
position: fixed;
bottom: 0;
}
.content {
position: absolute;
width: 100%;
top: 120px;
background-color: yellow;
z-index: 0;
}
#sidebar-wrapper {
z-index: 1000;
position: fixed;
left: 142px;
top: 0px;
margin-bottom: 60px;
width: 0;
height: 100%;
margin-left: -142px;
overflow-y: auto; overflow-x: hidden;
background: #eee;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
.topfilter {border-bottom:solid #333 2px; width:100%; height:40px; position:fixed; display:block; text-align:left; background-color:blue; -moz-box-sizing: border-box:
box-sizing: border-box:}
.filtertitle { position:relative; display:inline-block; color:#000; width:100%; }
.topfilter {border-bottom:solid #333 2px; width:100%; height:40px; position:fixed; display:block; text-align:left; background-color:blue; -moz-box-sizing: border-box:
box-sizing: border-box:}
.filtertitle { position:relative; display:inline-block; color:#000; width:100%; }
.topfilter {border-bottom:solid #333 2px; width:100%; height:40px; position:fixed; display:block; text-align:left; background-color:blue; -moz-box-sizing: border-box;
box-sizing: border-box;}
.bottomfilter {border-top: solid #333 2px; width:100%; height:50px; position:fixed; display:block; text-align:left; background-color:red; -moz-box-sizing: border-box; box-sizing: border-box; bottom:0;}
#wrapper.toggled #sidebar-wrapper {
width: 200px;
}
#page-content-wrapper {
width: 100%;
position: absolute;
padding: 15px;
}
#wrapper.toggled #page-content-wrapper {
position: absolute;
margin-right: -200px;
}
/* Sidebar Styles */
.sidebar-nav {
position: absolute;
top: 0px;
width: 100%;
margin: 0;
padding: 0;
list-style: none;
}
.sidebar-nav li {
text-indent: 20px;
line-height: 40px;
}
.sidebar-nav li a {
display: block;
text-decoration: none;
color: #999999;
}
.sidebar-nav li a:hover {
text-decoration: none;
color: #333;
background: rgba(255, 255, 255, 0.6);
}
.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;
}
#media screen and (min-width:768px) {
#wrapper {
padding-left: 300px;
}
#wrapper.toggled {
padding-left: 0;
}
#wrapper.toggled #sidebar-wrapper {
width: 0;
}
#page-content-wrapper {
padding: 20px;
position: relative;
}
#wrapper.toggled #page-content-wrapper {
position: relative;
margin-right: 0;
}
}
#media screen and (max-width:1526px) {
.content,
.footer {
width: 82%;
right: 0;
}
.header {width:82%;}
#sidebar-wrapper {
width: 18%;
}
}
#media screen and (max-width:1059px) {
.content,
.footer {
width: 80%;
right: 0;
}
.header {width:80%;}
#sidebar-wrapper {
width: 20%;
}
}
#media screen and (min-width:1527px) {
.content,
.footer {
width: 85%;
right: 0;
}
.header {width:85%;}
#sidebar-wrapper {
width: 15%;
}
}
#media screen and (max-width:991px) {
.content,
.footer {
width: 100%;
right: 0;
}
#sidebar-wrapper {
width:0;
}
The Answer was very simple: https://jsfiddle.net/4fqapznu/3/
All I had to do was:
Add min-width:100%, and replace width:100% with width:inherit on the parent container: .sidebar-nav
Then add width:inherit on the 2 children with position fixed items:
.topfilter and .bottomfilter
Here's the code that fixed it for me:
.sidebar-nav {
width:inherit; min-width:100%;
}
.topfilter {width:inherit; position:fixed;}
.bottomfilter { width:inherit; position:fixed;
Note: Now I have another problem with the fixed items overlapping the scrollbar, but I will ask that question on another thread unless someone has a quick answer on how to fix it.
Related
I am trying to add a border-top with 2px on my fixed navbar however on the a href hover it pushes all of the nav items down by 2px, I am trying to make it so it's static, any help is appreciated.
.fixed-nav-bar {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 9999;
width: 100%;
height: 70px;
background-color: #3f3f3f;
}
.fixed-nav-bar li, .fixed-nav-bar a {
height: 0 auto;
line-height: 50px;
width: 100px;
overflow: hidden;
}
.menu {
width: 90%;
max-width: 960px;
margin: 0 auto;
text-align: center;
}
.menu a, .menu a:visited {
color: #ffffff;
overflow: hidden;
}
.menu a:hover, .menu a:target {
display: block;
border-top: 2px solid #72BCD4;
color: #72BCD4;
}
.menu-items { display: inline-block; }
.menu-items li {
display: inline-block;
margin-right: 10px;
margin-left: 10px;
}
.menu-items a {
text-decoration: none;
}
.show, .hide {
display: none;
padding-left: 15px;
background-color: transparent;
background-repeat: no-repeat;
background-position: center left;
color: #dde1e2;
}
.show {
background-image: url(../assets/down-arrow-icon.png);
}
.hide {
background-image: url(../assets/up-arrow-icon.png);
}
<nav class="fixed-nav-bar">
<div id="menu" class="menu">
<!-- Example responsive navigation menu -->
<a class="show" href="#menu">Menu</a><a class="hide" href="#hidemenu">Menu</a>
<ul class="menu-items">
<li>HOME</li>
<li>ABOUT</li>
<li>DESIGNS</li>
<li>CONTACT</li>
</ul>
</div>
</nav>
It's because of no border. Either give a transparent border with the same width or use the colour of the border. But in your case, it's screwed up. So I changed the overflow: hidden and used margin-top: -2px:
.fixed-nav-bar {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 9999;
width: 100%;
height: 70px;
background-color: #3f3f3f;
}
.fixed-nav-bar li, .fixed-nav-bar a {
height: 0 auto;
line-height: 50px;
width: 100px;
}
.menu {
width: 90%;
max-width: 960px;
margin: 0 auto;
text-align: center;
}
.menu a, .menu a:visited {
color: #ffffff;
}
.menu a:hover, .menu a:target {
display: block;
border-top: 2px solid #72BCD4;
color: #72BCD4;
margin-top: -2px;
}
.menu-items {
display: inline-block;
}
.menu-items li {
display: inline-block;
margin-right: 10px;
margin-left: 10px;
}
.menu-items a {
text-decoration: none;
}
.show, .hide {
display: none;
padding-left: 15px;
background-color: transparent;
background-repeat: no-repeat;
background-position: center left;
color: #dde1e2;
}
.show {
background-image: url(../assets/down-arrow-icon.png);
}
.hide {
background-image: url(../assets/up-arrow-icon.png);
}
<nav class="fixed-nav-bar">
<div id="menu" class="menu">
<!-- Example responsive navigation menu -->
<a class="show" href="#menu">Menu</a><a class="hide" href="#hidemenu">Menu</a>
<ul class="menu-items">
<li>HOME</li>
<li>ABOUT</li>
<li>DESIGNS</li>
<li>CONTACT</li>
</ul>
</div>
</nav>
That's all because of box-sizing property. by default it adds value of paddings/margins/borders outside of content area, so element becomes bigger. Just define globally * {box-sizing: border-box;} it will make elements to fixed sizes. That means if element had no border, and then it adds, the element's area for content will be smaller, but the whole size will be the same. However, I strongly recommend you to use border at the beginning, otherwise, it will jump inside the element. You can set the color 'transparent' and it won't be visible. Then just by changing border-color it will be nicer.
I have created a little fiddler:
https://jsfiddle.net/marco_rensch/0hva2241/
this could be a possible solution
checkout CSS Code Changes between row 31 and 51
the key is to add a default border 2px transparent to the li's and change it by hover:
.menu-items li:hover{border-top: 2px solid #72BCD4;}
I would like to remove the white gap between my navbar and header , i dont know why i got the gap . i hope someone can help me
#import url(http://fonts.googleapis.com/css?family=Lato);
.container
{
width:800px;
overflow:hidden;
display:inline-block;
margin-top: 0px;
}
.side-bar
{
background:#74AFAD;
position:absolute;
height:100%;
width:200px;
color:#fff;
transition: margin-left 0.5s;
}
.side-bar ul
{
list-style:none;
padding:0px;
}
.side-bar ul li.menu-head
{
font-family: 'Lato', sans-serif;
padding:20px;
}
.side-bar ul li.menu-head a
{
color:#fff;
text-decoration:none;
height:50px;
}
.side-bar ul .menu-head a
{
color:#fff;
text-decoration:none;
height:50px;
margin: 0;
}
.side-bar ul .menu li a
{
color:#fff;
text-decoration:none;
display:inline-table;
width:100%;
padding-left:20px;
padding-right:20px;
padding-top:10px;
padding-bottom:10px;
}
.side-bar ul .menu li a:hover
{
border-left:3px solid #ECECEA;
padding-left:17px;
}
.side-bar ul .menu li a.active
{
padding-left:17px;
background:#D9853B;
border-left:3px solid #ECECEA;
}
.side-bar ul .menu li a.active:before {
content:"";
position: absolute;
width: 0;
height: 0;
border-top: 20px solid transparent;
border-bottom: 20px solid transparent;
border-left: 7px solid #D9853B;
margin-top: -10px;
margin-left: 180px;
}
.content
{
padding-left: 200px;
transition: padding-left 0.5s;
}
.active > .side-bar
{
margin-left:-150px;
transition: margin-left 0.5s;
}
.active > .content
{
padding-left:50px;
transition: padding-left 0.5s;
}
#logout_sidebar {
position: absolute;
display: inline-block;
bottom: 0;
width: 100%;
}
#media screen and (max-width: 768px) {
.row-offcanvas {
position: relative;
-webkit-transition: all 0.25s ease-out;
-moz-transition: all 0.25s ease-out;
transition: all 0.25s ease-out;
width:calc(100% + 220px);
}
.row-offcanvas-left
{
left: -220px;
}
.row-offcanvas-left.active {
left: 0;
}
.sidebar-offcanvas {
position: absolute;
top: 0;
}
}
#sidebar {
width: inherit;
min-width: 220px;
max-width: 220px;
background-color:#f5f5f5;
float: left;
height:100%;
position:relative;
overflow-y:auto;
overflow-x:hidden;
}
#main {
height:100%;
overflow:auto;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="bootstrap-3.3.7-dist/css/bootstrap.min.css">
<script src="bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/main.js"></script>
<link rel="stylesheet" type="text/css" href="css/navbar.css">
<title> Bagus Gamestore Admin Dashboard</title>
</head>
<body>
<div class="container">
<div class="row">
<div class="wrapper">
<div class="side-bar">
<ul>
<li class="menu-head">
ADMIN PANEL <span class="glyphicon glyphicon-align-justify pull-right"></span>
</li>
<div class="menu">
<li>
Dashboard <span class="glyphicon glyphicon-dashboard pull-right"></span>
</li>
<li>
User List<span class="glyphicon glyphicon-user pull-right"></span>
</li>
<li>
Add New Product<span class="glyphicon glyphicon-plus pull-right"></span>
</li>
<li>
Go to Website <span class="glyphicon glyphicon-globe pull-right"></span>
</li>
</div>
<div class="menu ">
<li id="logout_sidebar">
Logout<span class="glyphicon glyphicon-log-out pull-right"></span>
</li>
</div>
</ul>
</div>
<div class="content">
<!-- show user list -->
<!-- end of show user list-->
</div>
</div>
</div>
</div>
</body>
</html>
as you can see , theres a litle gap over the ADMIN PANEL , how do i remove those gap ? thank you before
You need to position the div .side-bar explicitly at the top of its parent using top: 0;. (Note this di is already positioned absolute)
.side-bar{
top: 0;
}
Snippet below
#import url(http://fonts.googleapis.com/css?family=Lato);
.container {
width: 800px;
overflow: hidden;
display: inline-block;
margin-top: 0px;
}
.side-bar {
background: #74AFAD;
position: absolute;
height: 100%;
width: 200px;
color: #fff;
transition: margin-left 0.5s;
}
.side-bar ul {
list-style: none;
padding: 0px;
}
.side-bar ul li.menu-head {
font-family: 'Lato', sans-serif;
padding: 20px;
}
.side-bar ul li.menu-head a {
color: #fff;
text-decoration: none;
height: 50px;
}
.side-bar ul .menu-head a {
color: #fff;
text-decoration: none;
height: 50px;
margin: 0;
}
.side-bar ul .menu li a {
color: #fff;
text-decoration: none;
display: inline-table;
width: 100%;
padding-left: 20px;
padding-right: 20px;
padding-top: 10px;
padding-bottom: 10px;
}
.side-bar ul .menu li a:hover {
border-left: 3px solid #ECECEA;
padding-left: 17px;
}
.side-bar ul .menu li a.active {
padding-left: 17px;
background: #D9853B;
border-left: 3px solid #ECECEA;
}
.side-bar ul .menu li a.active:before {
content: "";
position: absolute;
width: 0;
height: 0;
border-top: 20px solid transparent;
border-bottom: 20px solid transparent;
border-left: 7px solid #D9853B;
margin-top: -10px;
margin-left: 180px;
}
.content {
padding-left: 200px;
transition: padding-left 0.5s;
}
.active>.side-bar {
margin-left: -150px;
transition: margin-left 0.5s;
}
.active>.content {
padding-left: 50px;
transition: padding-left 0.5s;
}
#logout_sidebar {
position: absolute;
display: inline-block;
bottom: 0;
width: 100%;
}
#media screen and (max-width: 768px) {
.row-offcanvas {
position: relative;
-webkit-transition: all 0.25s ease-out;
-moz-transition: all 0.25s ease-out;
transition: all 0.25s ease-out;
width: calc(100% + 220px);
}
.row-offcanvas-left {
left: -220px;
}
.row-offcanvas-left.active {
left: 0;
}
.sidebar-offcanvas {
position: absolute;
top: 0;
}
}
#sidebar {
width: inherit;
min-width: 220px;
max-width: 220px;
background-color: #f5f5f5;
float: left;
height: 100%;
position: relative;
overflow-y: auto;
overflow-x: hidden;
}
#main {
height: 100%;
overflow: auto;
}
.side-bar {
top: 0;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="bootstrap-3.3.7-dist/css/bootstrap.min.css">
<script src="bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/main.js"></script>
<link rel="stylesheet" type="text/css" href="css/navbar.css">
<title> Bagus Gamestore Admin Dashboard</title>
</head>
<body>
<div class="container">
<div class="row">
<div class="wrapper">
<div class="side-bar">
<ul>
<li class="menu-head">
ADMIN PANEL <span class="glyphicon glyphicon-align-justify pull-right"></span>
</li>
<div class="menu">
<li>
Dashboard <span class="glyphicon glyphicon-dashboard pull-right"></span>
</li>
<li>
User List<span class="glyphicon glyphicon-user pull-right"></span>
</li>
<li>
Add New Product<span class="glyphicon glyphicon-plus pull-right"></span>
</li>
<li>
Go to Website <span class="glyphicon glyphicon-globe pull-right"></span>
</li>
</div>
<div class="menu ">
<li id="logout_sidebar">
Logout<span class="glyphicon glyphicon-log-out pull-right"></span>
</li>
</div>
</ul>
</div>
<div class="content">
<!-- show user list -->
<!-- end of show user list-->
</div>
</div>
</div>
</div>
</body>
</html>
Applying
margin: 0px;
to your body and removing
display:inline-block;
from your container appears to
work, but that might not be what you want depending on what other elements you want on your page.
I would like to add a transition on the overlay but i can't work out which class it needs to be on to make it work. I'd like it to transition down from the top. Something along the lines of
-webkit-transform: translateY(-100%);
-ms-transform: translateY(-100%);
transform: translateY(-100%);
-webkit-transition: -webkit-transform 0.3s;
transition: transform 0.3s;
HTML
<ul class="about-image">
<li>
<div class="image"></div>
<div class="overlay"><div class="bt1">Dan Morris</div><div class="bt2">Multimedia Journalist</div></div>
</li>
</ul>
CSS
.image{
height: 252px;
width: 252px;
margin-left: auto;
margin-right: auto;
margin-top: 40px;
margin-bottom: 40px;
background-image: url(../images/danmorris_profile.png);
}
.overlay{
width:252px;
height:252px;
display:none;
position:absolute;
top:40px;
left:0px;
}
.overlay div {
position:relative;
display:inline-block;
top:40px;
margin: 40px 5px 0 0;
}
ul { list-style: none; width: 252px;
margin-left: auto;
margin-right: auto;
margin-bottom: 60px;
}
ul li {
position: relative;
display: inline-block;
width: 252px;
height: 252px;
}
li:hover .overlay {
display:block;
background-color:black;
opacity:0.75;
}
.bt1 {
background-color:orange;
width:50px;
height:50px;
}
.bt2 {
background-color:green;
width:50px;
height:50px;
}
Any help would be greatly appreciated. Thanks in advance
You need to apply the effect to the .overlay - Transition cannot be set to transform as it is not supported (Reference).
To get the effect you are after, try the following:
Remove your display: none; - this cannot be animated.
Style your .overlay completely but set top: -100%;, position: absolute;, and transition: top 0.3s ease-in-out;.
On hover, just change to top: 0;.
Finally, add overflow: hidden; to the li container.
ul {
list-style: none;
width: 252px;
margin: 40px auto 60px auto;
}
ul li {
position: relative;
display: inline-block;
width: 252px;
height: 252px;
overflow: hidden;
}
li:hover .overlay {
top: 0;
}
.overlay{
width:252px;
height:252px;
opacity: 0.75;
position:absolute;
background-color:black;
top:-100%;
transition: top 0.3s ease-in-out;
}
.overlay div {
position:relative;
display:inline-block;
top:40px;
margin: 40px 5px 0 0;
}
.bt1 {
background-color:orange;
width:50px;
height:50px;
}
.bt2 {
background-color:green;
width:50px;
height:50px;
}
<ul class="about-image">
<li>
<img src="http://placehold.it/252x252"></div>
<div class="overlay">
<div class="bt1">Dan Morris</div>
<div class="bt2">Multimedia Journalist</div>
</div>
</li>
</ul>
For convenience I have moved your .image to an element - but it will work with both. Also added some ease for smoothness.
Pen here
I've taken this bootstrap code for a simple sidebar:http://startbootstrap.com/template-overviews/simple-sidebar/
What I need is for this sidebar code to respect the footer and header in the following code:
HTML:
Header Content
<!-- BEGIN: Page Content -->
<div id="container">
<div id="content">
<! -- BEGIN: Side Bar Navigation -->
<!-- Sidebar -->
<div id="sidebar-wrapper">
<ul class="sidebar-nav">
<li class="sidebar-brand">
<a href="#">
Start Bootstrap
</a>
</li>
<li>
Dashboard
</li>
<li>
Shortcuts
</li>
<li>
Overview
</li>
<li>
Events
</li>
<li>
About
</li>
<li>
Services
</li>
<li>
Contact
</li>
</ul>
</div>
<!-- /#sidebar-wrapper -->
<!-- END: Sidebar Navigation -->
</div>
</div>
<!-- END: Page Content -->
<!-- BEGIN: Sticky Footer -->
<div id="footer_container">
<div id="footer">
Footer Content
</div>
</div>
<!-- END: Sticky Footer -->
</body>
</html>
CSS:
/* Reset body padding and margins */
body { margin:0; padding:0; }
/* Make Header Sticky */
#header_container {
background:#eee;
border:1px solid #666;
height:60px;
left:0;
position:fixed;
width:100%;
top:0;
}
#header{
line-height:60px;
margin:0 auto;
width:940px;
text-align:center;
}
/* CSS for the content of page. I am giving top and bottom padding of 80px to make sure the header and footer do not overlap the content.*/
#container {
margin:0
auto; overflow:
auto; padding;0px 0
width:940px;
}
#content{
}
/* Make Footer Sticky */
#footer_container {
background:#eee;
border:1px solid #666;
bottom:0;
height:60px;
left:0;
position:fixed;
width:100%;
}
#footer {
line-height:60px;
margin:0 auto;
width:940px;
text-align:center;
}
/* BEGIN: SideBar Navigation Baare */
#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;
}
#wrapper.toggled {
padding-left: 250px;
}
#sidebar-wrapper {
z-index: 1000;
position: fixed;
left: 250px;
width: 0;
height: 100%;
margin-left: -250px;
overflow-y: auto;
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%;
padding: 15px;
}
#wrapper.toggled #page-content-wrapper {
position: absolute;
margin-right: -250px;
}
/* Sidebar Styles */
.sidebar-nav {
position: absolute;
top: 0;
width: 250px;
margin: 0;
padding: 0;
list-style: none;
}
.sidebar-nav li {
text-indent: 20px;
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);
}
.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;
}
#media(min-width:768px) {
#wrapper {
padding-left: 250px;
}
#wrapper.toggled {
padding-left: 0;
}
#sidebar-wrapper {
width: 250px;
}
#wrapper.toggled #sidebar-wrapper {
width: 0;
}
#page-content-wrapper {
padding: 20px;
}
#wrapper.toggled #page-content-wrapper {
position: relative;
margin-right: 0;
}
}
I am working on an site where I made an fixed footer which I never did before. I got the basic code from this tutorial: http://tutorialzine.com/2013/08/slideout-footer-css/ the links work in there but as my site also got an Fixed header It messes up a bit. The links arent hoverable or clickable. How can I make my links clickable It is not that they worked when I even copyd the code in to check if the links would work then they didnt either.
Header:
<header>
<nav>
<div class="FSG-box">
<img id="FSG-logo" src="imgs/FSG.png"/>
</div>
<ul class="menu">
<li><strong>Home</strong></li>
<li>partners</li>
<li>education</li>
<li>about</li>
<li>contact</li>
</ul>
</nav>
<section id="intro">
<div class="transparent">
</div>
<div class="boxhome">
<h1>Welcome at the Food Safety Group</h1>
<div class="line1"></div>
<div class="line2"></div>
<div class="line3"></div>
</div>
</section>
</header>
Header CSS:
section {
overflow: hidden; height: 900px;
}
nav{
width: 100%;
height: 100px;
background-color: #f4f4f4;
left: 0;
top: 0;
position: fixed;
z-index: 10000;
}
.menu{
float: right;
position: relative;
right: 100px;
top:15px;
}
.menu li:hover
{
-webkit-transform:scale(1.3);
transform:scale(1.3);
}
.menu li{
color: #000;
font-weight: 300;
list-style: none;
text-decoration: none;
float: left;
margin-left: 25px;
font-size: 18px;
-webkit-transition: all 0.7s ease;
transition: all 0.7s ease;
}
#FSG-logo{
position: absolute;
top:13px;
left:13px;
max-width:450px;
}
.transparent {
position: absolute;
background-color: #000;
opacity: 0.625;
filter: alpha(opacity=60); /* For IE8 and earlier */
width: 100%;
height: 100%;
}
.boxhome:hover{
-webkit-transform:scale(1.05);
transform:scale(1.05);
height: 100%;
}
.boxhome {
width:100%;
margin:0 auto;
-webkit-transition: all 0.7s ease;
transition: all 0.7s ease;
}
#intro {
z-index: 10;
/* sets it above .slide1 */
/* this pushes it below .slide1 in the scroll */
min-height:1100px;
max-height: 1200px;
position: absolute;
width: 100%;
left: 0;
top:0;
background: url(../imgs/kassen.jpg);
}
#intro h1 {
font-size: 36pt;
text-align:center;
position: relative;
font-weight: 400;
top:320px;
}
Footer + Div above HTML:
<article class="result">
<div class="transparent2">
</div>
<div class="power">
<h2>The result of a well organized group</h2>
<h3>The six partners in this group can supply all automation required to produce a plant, harvest the product and supply the product safe and sound to the supermarket.</h3>
</div>
</article>
<footer>
<ul>
<li>
<p class="home">Where to Find Us</p>
<ul>
<li>Visser Horti Systems</li>
<li>Postoffice box 5103</li>
<li>3295 ZG 's-Gravendeel</li>
<li>The Netherlands</li>
</ul>
</li>
<li>
<p class="services">Sign up for our News Letter</p>
<ul>
<li>3D modeling</li>
<li>Web development</li>
<li>Mobile development</li>
<li>Web & Print Design</li>
</ul>
</li>
<li>
<p class="reachus">Reach us</p>
<ul>
<li><a style="cursor: pointer;" href="http://www.google.com/maps/ms?ie=UTF8&hl=nl&msa=0&msid=117943608112586518975.00000111c1da021ca60eb&om=1&t=h&z=17&ll=51.787568" target="_blank">Google Maps</a></li>
<li>Phone: +31 (0) 78 673 9800</li>
<li>Fax: +31 (0) 78 673 3434</li>
<li>info#visser.eu</li>
</ul>
</li>
</ul>
</footer>
Footer CSS:
.result {
min-height: 750px;
width: 100%;
left: 0px;
position: absolute;
background: url('../imgs/result.jpg') no-repeat scroll center center transparent;
top: 2830px;
z-index:1;
}
footer{
height:400px;
width: 100%;
position: relative;
z-index:-2;
background-color: #303030;
}
footer > ul{
width:50%;
position:fixed;
left:50%;
bottom:0;
margin-left:-480px;
padding-bottom: 200px;
z-index:-1;
}
footer > ul > li{
width:33.3%;
float:left;
}
footer ul{
list-style: none;
}
/* The links */
footer > ul > li ul li{
text-transform: uppercase;
font-weight:bold;
line-height:1.8;
}
footer > ul > li ul li a{
text-decoration: none !important;
color: #fff !important;
}
footer > ul > li ul li a:hover{
color:#fff !important;
}
footer a.logo{
color: #fff !important;
text-decoration: none !important;
font-size: 14px;
font-weight: bold;
position: relative;
text-transform: uppercase;
margin-left: 16px;
display: inline-block;
margin-top: 7px;
}
footer a.logo i{
font-style: normal;
position: absolute;
width: 60px;
display: block;
left: 48px;
top: 18px;
font-size: 12px;
color: #fff;
}
footer a.logo:before{
content: '';
display: inline-block;
background: url('../img/sprite.png') no-repeat -19px -70px;
width: 48px;
height: 37px;
vertical-align: text-top;
}
footer p{
width: 90%;
margin-right: 10%;
padding: 9px 0;
line-height: 18px;
background-color: #058cc7;
font-weight: bold;
font-size: 14px;
color:#fff;
text-transform: uppercase;
text-shadow: 0 1px rgba(0,0,0,0.1);
box-shadow: 0 0 3px rgba(0,0,0,0.3);
margin-bottom: 20px;
opacity:0.9;
cursor:default;
-webkit-transition: opacity 0.4s;
-moz-transition: opacity 0.4s;
transition: opacity 0.4s;
}
footer > ul > li:hover p{
opacity:1;
}
footer p:before{
content: '';
display: inline-block;
background: url('../img/sprite.png') no-repeat;
width: 16px;
height: 18px;
margin: 0 12px 0 15px;
vertical-align: text-bottom;
}
footer p.home{
background-color: #F58020;
}
footer p.home:before{
background-position: 0 -110px;
}
footer p.services{
background-color: #F58020;
}
footer p.services:before{
background-position: 0 -129px;
}
footer p.reachus{
background-color: #F58020;
}
footer p.reachus:before{
background-position: 0 -89px;
}
z-indexon all divs like the .result fixed the problem