In it I just added a submenu using but it seems the CSS code did not allow this and I got nothing. I am getting this code from a template I found online.
http://way2themes.com/blogger-templates/spraymag.zip
There are more templates like this. So I am facing a common problem in them all. How do i isolate the code that allows me to add sub menus, sub sub menus?
This is the CSS that I am working on.
#header .menu ul li {
float: left;
display: inline-block;
height: 40px;
border-right: solid 1px rgba(255,255,255,0.05);
border-top: none;
}
#header .menu ul li a{
padding: 0 12px 0 12px;
display: block;
border: none !important;
text-decoration: none;
line-height: inherit;
border-bottom: solid 1px transparent;
color: #999;
}
#header .menu ul li a:hover {
background: rgba(255,255,200,0.1); color: #FFF; box-shadow: inset 0px 0px 10px rgba(0,0,0,0.1);
}
#main-menu ul li:first-child {
margin-left: 10px;
}
.main-navigation-wrapper {
display: block; margin-bottom: 30px;
position: relative; margin-left: auto; margin-right: auto;
}
ul#main-nav {
display: block; background: #363D40; border-top: solid 5px #666; border-top-color: rgba(255,255,255,0.15); padding-right: 40px; min-height: 40px; margin-bottom: 0 !important; box-shadow: inset 0 -20px 0 rgba(0,0,0,0.09); -webkit-transition: all 0.2s ease; -moz-transition: all 0.2s ease; -o-transition: all 0.2s ease; -ms-transition: all 0.2s ease; transition: all 0.2s ease;
zoom: 1;
}
#main-nav > li {
float: left; display: inline-block; position: relative; border-top: solid 5px transparent;
margin-top: -5px;
line-height: 21px;
}
#main-nav > li > a:hover {
border-color: transparent;
background-color: #444;
background-color: rgba(255,255,255,0.1);
color: #FFF;
}
#main-nav > li > a {
display: block;
letter-spacing: 1px;
padding: 10px 20px;
font-size: 13px;
font-weight: bold;
text-transform: uppercase;
border-right: solid 1px rgba(255,255,255,0.07);
color: #FFF;
color: rgba(255,255,255,0.7);
position: relative;
z-index: 99997;
box-shadow: inset 0px -19px 0px rgba(0,0,0,0);
text-decoration: none;
line-height: 21px;
-webkit-transition: background-color 0.2s ease 0s, border 0.2s ease 0s, color 0.2s ease 0s, opacity 0.2s ease-in-out 0s, box-shadow 0.2s ease-in-out 0s;
-moz-transition: background-color 0.2s ease 0s, border 0.2s ease 0s, color 0.2s ease 0s, opacity 0.2s ease-in-out 0s, box-shadow 0.2s ease-in-out 0s;
-o-transition: background-color 0.2s ease 0s, border 0.2s ease 0s, color 0.2s ease 0s, opacity 0.2s ease-in-out 0s, box-shadow 0.2s ease-in-out 0s;
-ms-transition: background-color 0.2s ease 0s, border 0.2s ease 0s, color 0.2s ease 0s, opacity 0.2s ease-in-out 0s, box-shadow 0.2s ease-in-out 0s;
transition: background-color 0.2s ease 0s, border 0.2s ease 0s, color 0.2s ease 0s, opacity 0.2s ease-in-out 0s, box-shadow 0.2s ease-in-out 0s;
}
.responsive-nav-wrapper {
position: relative;
display: block;
display: none;
z-index: 9999;
}
#responsive-nav , .responsive-nav-wrapper #resp-menu {
background: #363D40;
}
#responsive-nav {
border-top: none;
position: relative;
cursor: pointer;
padding-right: 20px;
z-index: 99999999999999;
}
#responsive-nav:hover, .responsive-nav-wrapper.responsive-active #responsive-nav {
background: #498AB8;
}
#responsive-nav:hover .nav-icon, .responsive-nav-wrapper.responsive-active #responsive-nav .nav-icon, #responsive-top-nav .nav-icon:hover, .responsive-top-nav-wrapper.responsive-active #responsive-top-nav .nav-icon {
border-top-color: #FFF;
border-bottom-color: #FFF;
}
#responsive-nav:hover .text-nav, .responsive-nav-wrapper.responsive-active .text-nav {
color: #FFF;
}
.responsive-nav-wrapper.responsive-active #resp-menu {
display: block;
z-index: 9999;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
#responsive-nav {
display: block;
background: #363D40;
border-top: solid 5px #666;
border-top-color: rgba(255,255,255,0.15);
padding-right: 40px;
min-height: 40px;
margin-bottom: 0 !important;
box-shadow: inset 0 -20px 0 rgba(0,0,0,0.09);
-webkit-transition: all 0.2s ease;
-moz-transition: all 0.2s ease;
-o-transition: all 0.2s ease;
-ms-transition: all 0.2s ease;
transition: all 0.2s ease;
}
.responsive-top-nav-wrapper {
width: auto;
display: none;
z-index: 9999;
height: 40px;
}
#responsive-top-nav {
border-top: none;
position: relative;
padding-right: 60px;
height: 40px;
z-index: 9999;
}
#responsive-top-nav .nav-icon {
margin-top: 11px;
cursor: pointer;
}
.responsive-top-nav-wrapper #top-resp-menu {
display: none;
position: absolute;
top: 40px;
left: 15px;
width: auto;
background-color: #fff;
background-color: rgba(255,255,255,0.98);
border: solid 1px #e7e7e7;
}
#top-resp-menu #top-menu-ul, #top-resp-menu ul {
margin-bottom: 0px;
}
#top-resp-menu li a {
display: block;
width: 100%;
color: #888;
text-transform: uppercase;
font-weight: bold;
font-size: 13px;
padding: 8px 70px 8px 15px;
border-bottom: solid 1px #e9e9e9;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
.text-nav {
float: left;
padding-left: 20px;
line-height: 40px;
text-transform: uppercase;
font-size: 13px;
color: #eee;
color: rgba(255,255,255,0.7);
font-weight: bold;
letter-spacing: 1px;
-webkit-transition: all 0.2s ease;
-moz-transition: all 0.2s ease;
-o-transition: all 0.2s ease;
-ms-transition: all 0.2s ease;
transition: all 0.2s ease;
}
#responsive-nav .nav-icon, #responsive-top-nav .nav-icon {
margin-top: 12px;
display: block;
border-bottom: 10px double #aaa;
border-top: 3px solid #aaa;
height: 4px;
width: 25px;
float: right;
-webkit-transition: all 0.2s ease;
-moz-transition: all 0.2s ease;
-o-transition: all 0.2s ease;
-ms-transition: all 0.2s ease;
transition: all 0.2s ease;
border-top-color: rgba(255,255,255,0.7);
border-bottom-color: rgba(255,255,255,0.7);
}
.responsive-nav-wrapper #resp-menu {
display: none;
position: absolute;
top: 44px;
width: 100%;
background-color: #363D40;
}
#resp-menu li, #top-resp-menu li {
display: block;
float: none;
}
#resp-menu ul, #top-resp-menu ul, #top-resp-menu ul li, #resp-menu li {
width: 100% !important;
}
#resp-menu li a {
display: block;
color: #FFF;
color: rgba(255,255,255,0.7);
text-transform: uppercase;
font-weight: bold;
font-size: 13px;
padding: 8px 20px 8px 15px;
border-bottom: solid 1px #444;
border-left: solid 5px #444;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
.responsive-top-nav-wrapper {
display: none;
and this is the HTML.
Please have a look and help me.
<div class='inner-wrap'>
<nav class='menu-main-navigation-container'>
<ul id='main-nav'>
<!-- Main Menu -->
<li><a href='#'>Home</a></li>
<li><a href='#'>Blog</a></li>
<li><a href='#'>Lifestyle</a></li>
<li><a href='#'>Travel</a>
<ul>
<li><a href='#'>Sub Sub-Menu 1</a></li>
<li><a href='#'>Sub Sub-Menu 2</a>
<ul>
<li><a href='#'>Sub Sub-Menu 1</a></li>
<li><a href='#'>Sub Sub-Menu 2</a></li>
<li><a href='#'>Sub Sub-Menu 3</a></li>
<li><a href='#'>Sub Sub-Menu 4</a></li>
</ul>
<li><a href='#'>Sub Sub-Menu 3</a></li>
<li><a href='#'>Sub Sub-Menu 4</a></li>
</ul>
</li>
<li><a href='#'>Archives</a></li>
<li><a href='#'>Sample Page</a></li>
<li><a href='#'>Contact</a></li>
<div style='clear:both'/>
</ul> </nav>
On this picture you see a label beside a a-link.
CSS for both:
.btn {
zoom: 1;
vertical-align: baseline;
cursor: pointer;
text-align: center;
text-decoration: none;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
background: #666;
color: #fff;
display: inline-block;
padding: 10px 15px;
text-align: left;
font-size: 1em;
border: 0;
margin: 0;
-webkit-transition: background 0.2s ease-in-out;
-moz-transition: background 0.2s ease-in-out;
-ms-transition: background 0.2s ease-in-out;
-o-transition: background 0.2s ease-in-out;
transition: background 0.2s ease-in-out;
}
How to remove the space beneath the label?
The problem was the line-height.
.btn {
line-height: 1.4em;
}
i have a code HTML CODE:
<div class="wrapper-demo">
<div id="dd" class="wrapper-dropdown-2" tabindex="1">Sign in with
<ul class="dropdown">
<li><i class="icon-twitter icon-large"></i>Twitter</li>
<li><i class="icon-github icon-large"></i>Github</li>
<li><i class="icon-facebook icon-large"></i>Facebook</li>
</ul>
</div>
</div>
AND CSS:
.wrapper-dropdown-2 {
position: relative;
width: 200px;
margin: 0 auto;
padding: 10px 15px;
background: #fff;
border-left: 5px solid orange;
cursor: pointer;
text-align: left;
cursor: pointer;
outline: none;
}
.wrapper-dropdown-2:after {
content: "";
width: 0;
height: 0;
position: absolute;
right: 16px;
top: 50%;
margin-top: -3px;
border-width: 6px 6px 0 6px;
border-style: solid;
border-color: grey transparent;
}
.dropdown {
display:none;
}
.wrapper-dropdown-2:hover ul.dropdown {
position: absolute;
display:block;
top: 100%;
left: -5px;
right: 0px;
background: white;
-webkit-transition: all 0.3s ease-out;
-moz-transition: all 0.3s ease-out;
-ms-transition: all 0.3s ease-out;
-o-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
list-style: none;
opacity: 0;
pointer-events: none;
}
.wrapper-dropdown-2 .dropdown li a {
display: block;
text-decoration: none;
color: #333;
border-left: 5px solid;
padding: 10px;
-webkit-transition: all 0.3s ease-out;
-moz-transition: all 0.3s ease-out;
-ms-transition: all 0.3s ease-out;
-o-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
}
http://jsfiddle.net/pvt3e/
and i try, in hover mouse to: Sign in with open the drop down but its not work !
i cant work with js. Because I have a problem with 1.8.2, but I think we can find a solution with CSS
try this
.wrapper-dropdown-2:hover ul{
display:block;
}
updated jsFiddle File
also remove .dropdown:hover from your style
You are missing to add hover code to see drop down when hover over. add css for hover.
.wrapper-dropdown-2:hover .dropdown
{
display:block;
}
Live Demo
Just Replace Your This CSS
.dropdown:hover {
/* Size & position */
position: absolute;
display:block;
top: 100%;
left: -5px;
right: 0px;
/* Styles */
background: white;
-webkit-transition: all 0.3s ease-out;
-moz-transition: all 0.3s ease-out;
-ms-transition: all 0.3s ease-out;
-o-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
list-style: none;
/* Hiding */
opacity: 0;
pointer-events: none;
}
To My CSS and Get Result
.wrapper-dropdown-2:hover > .dropdown {
position: absolute;
display:block;
left: -45px;
background: white;
top:24px;
}
You will need to initialize your javascript as well as link to jquery. I see you are using a dropdown from Codrops why dont you just download the source?
The arrows before the title are displayed using a :before. The problem only occur on Internet Explorer.
// edit : Mistake there, my styling is on p a.
Maybe is it the issue ?
So, here's the code:
.special-title {
font-size: 24px;
color: #a4a19e;
line-height: 1.2;
position: relative;
padding: 8px 0 8px 38px;
border-top: 1px solid #e2dbcf;
border-bottom: 1px solid #e2dbcf;
margin-top: 49px;
margin-bottom: 25px; }
.special-title:before {
content: url('../img/general-title-decoration.svg?1369571463');
position: absolute;
width: 28px;
left: 0;
top: 23px;
margin-top: -13px; }
and for the button:
.btn-call-to-action a {
background: #8e8287;
color: #f5f3e2;
padding: 2px 60px 2px 10px;
height: 35px;
line-height: 40px;
margin-top: 6px;
display: inline-block;
position: relative;
border-radius: 2px;
height: 40px;
white-space: nowrap;
-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
-ms-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out; }
.btn-call-to-action a:hover:after {
-webkit-transform: translatex(6px);
-moz-transform: translatex(6px);
-o-transform: translatex(6px);
-ms-transform: translatex(6px);
transform: translatex(6px); }
.btn-call-to-action a:hover {
background: #6f6469;
border-bottom: none; }
.btn-call-to-action a:after {
content: url('../img/general-white-arrow.svg?1369574895');
position: absolute;
width: 35px;
right: 15px;
top: 0px;
-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
-ms-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out; }
and here's the live site: http://aurelieremia.be/tfa/
In .special-title:before, since you're using absolute positioning, remove
margin-top:-13px;
and just use
top:10px;
instead. Then, declare a height as well as a width.
see http://jsfiddle.net/6TdB6/
I am trying to create a menu and style it. I have also used some css animations to show a description (span) when hovered. This menu is working properly under Firefox. But in Chrome, there's a white space above the menu. When I check the li tag through Firebug, its show me that the li element is not aligned properly. Its moved upward. Its not happening on firefox. (please check the screenshots below). How can I fix this?
Update : I have just uploaded the site to Heroku : http://aqueous-wildwood-4051.herokuapp.com/. You will see the issue in this live site.
In chrome :
In Firefox :
Here's the code of my sidebar :
<aside id="sidebar" role="complementary">
<nav id="side-nav" role="navigation">
<ul>
<li ><div id='side-nav-home' class='listitem'><span class='listtitle'>Home</span><span class='description'>Home page of SLNYAA</span></div></li>
<li ><div id='side-nav-about' class='listitem'><span class='listtitle'>About Us</span><span class='description'>Learn more about us</span></div></li>
<li ><div id='side-nav-handbook' class='listitem'><span class='listtitle'>Handbook</span><span class='description'>Read our handbook</span></div></li>
<li ><div id='side-nav-join' class='listitem'><span class='listtitle'>Join Us</span><span class='description'>Join our program</span></div></li>
</ul>
</nav>
</aside>
Here is the CSS :
#sidebar {
border-left: 1px solid #EDEDED;
box-shadow: -3px 0 9px rgba(217, 217, 217, 0.2);
float: right;
min-height: 365px;
width: 24%;
#side-nav{
ul {
margin-top: 0px !important;
height: 187px;
list-style: none outside none;
margin-left: 0;
padding-left: 0;
width: 100%;
li{
height: 46px;
a{
text-decoration: none;
font-size: 14px;
color: #fff;
text-shadow: 1px 1px 1px #757575;
border-right: 1px solid rgba(217, 217, 217, 0);
-webkit-transition: all 0.3s ease-in;
-moz-transition: all 0.3s ease-in;
-o-transition: all 0.3s ease-in;
-ms-transition: all 0.3s ease-in;
transition: all 0.3s ease-in;
.listitem {
list-style: none outside none;
height: 32px;
text-align: center;
padding-top: 10px;
-webkit-transition: all 0.3s ease-in;
-moz-transition: all 0.3s ease-in;
-o-transition: all 0.3s ease-in;
-ms-transition: all 0.3s ease-in;
transition: all 0.3s ease-in;
.description {
visibility: hidden;
position: absolute;
font-size: 12px;
color: #FFFFFF;
font-weight: bold;
position: absolute;
margin-left: 8px;
margin-top: 4px;
opacity: 0;
-webkit-transition: all 0.6s ease-in;
-moz-transition: all 0.6s ease-in;
-o-transition: all 0.6s ease-in;
-ms-transition: all 0.6s ease-in;
transition: all 0.6s ease-in;
}
&:hover {
text-align: left;
.description {
visibility: visible;
opacity: 1;
}
.listtitle{
margin-left: 7px;
border-right: 1px solid #FFFFFF;
padding-right: 7px;
}
}
}
}
}
#side-nav-home{
background-color: #ED0042;
border: 2px solid #E87998;
}
#side-nav-about{
background-color: #e1cf3b;
border: 2px solid #C4BD80;
}
#side-nav-handbook{
background-color: #009dda;
border: 2px solid #5EADCC;
}
#side-nav-join{
background-color: #6ba01e;
border: 2px solid #98AB7D;
}
}
}
}
Add display: block to the a CSS style
#main-container-border #main-container #sidebar #side-nav ul li a {
display: block;
text-decoration: none;
font-size: 14px;
color: #fff;
text-shadow: 1px 1px 1px #757575;
border-right: 1px solid rgba(217, 217, 217, 0);
-webkit-transition: all 0.3s ease-in;
-moz-transition: all 0.3s ease-in;
-o-transition: all 0.3s ease-in;
-ms-transition: all 0.3s ease-in;
transition: all 0.3s ease-in;
}
jsfiddle