I have a problem about the image overlap the dropdown menu that I can't hover.
The image I use -webkit-animation. When it rotate to the menu the dropdown will disable.
How can I let the rotate image doesn't effect the dropdown menu work.
I tried z-index and the image layer was lower than menu but dropdown menu still didn't work when mouse hover the gray image.I want the menu right to use. Any solution?
Please help.
Here is my code & Fiddle http://jsfiddle.net/bNBp3/130/
ul#main-navigation {
display:block;
border-bottom:1px solid #ccc;
margin:0 auto 0px auto;
min-height:21px;
padding:0;
width:100%;
clear:both;
}
ul#main-navigation li {
display:block;
float:left;
list-style:none;
margin:0 5px 0 0;
padding:0;
position:relative;
min-height:22px;
min-width:30%;
}
ul#main-navigation li a {
color:#000;
display:block;
padding:2px;
text-decoration:none;
}
ul#main-navigation li a.current, ul#main-navigation li a.section {
color:#fff;
}
ul#main-navigation li ul {
background:#eee;
position:absolute;
left:-1px;
top:21px;
display:none;
overflow:hidden;
padding:0px;
z-index:5;
width:100%;
border:1px solid #ccc;
}
ul#main-navigation li ul li {
display:block;
float:none;
margin:0;
width:100%;
border-bottom:1px solid #ccc;
}
ul#main-navigation li ul li a {
background:#eee;
display:block;
color:#333;
zoom:100%;
}
ul#main-navigation li ul li a:hover {
background:#fff;
}
ul#main-navigation li:hover {
background:#eee;
border-left:1px solid #ccc;
border-right:1px solid #ccc;
}
ul#main-navigation li:hover a.current {
background:#eee; color:#000;
}
ul#main-navigation li:hover ul {
display:block;
}
div#mcake{
display:block;
overflow: hidden;
background-color:#ccc;
background-repeat: no-repeat;
position:absolute;
left:200px;
left:-250px\9;
top:10px;
top:100px\9;
width:200px;
height:200px;
-webkit-animation:airplane-wiggle 30s ease infinite;
}
#-webkit-keyframes airplane-wiggle
{
from{-webkit-transform:rotateX(0deg) rotateY(5deg) rotateZ(5deg);}
50%{-webkit-transform:rotateX(-40deg) rotateY(-5deg) rotateZ(-10deg);}
to{-webkit-transform:rotateX(0deg) rotateY(5deg) rotateZ(5deg);}
}
maybe you could give the image a: z-index: -10; (or something like that) in your css.
I dont know if this will work but its worth the try.
I think the standard z-index is 0 so now your image and menu are on the same "layer". i think putting it on -10 will work
you could use margin-top in mcake to push the image down
div#mcake{
margin-top: 100px;
display:block;
overflow: hidden;
background-color:#ccc;
background-repeat: no-repeat;
position:absolute;
left:200px;
left:-250px\9;
...
}
I think the z-index would resolve your problem , along with this you should add the below code in your css section for this to be working in all browsers,
add animation:airplane-wiggle 30s ease infinite; in div#mcake.
div#mcake{
.......
........
....
-webkit-animation:airplane-wiggle 30s ease infinite;
animation:airplane-wiggle 30s ease infinite;
}
and #keyframes
#keyframes airplane-wiggle
{
from{transform:rotateX(0deg) rotateY(5deg) rotateZ(5deg);}
50%{transform:rotateX(-40deg) rotateY(-5deg) rotateZ(-10deg);}
to{transform:rotateX(0deg) rotateY(5deg) rotateZ(5deg);}
}
Related
This is very strange. Here's the code:
nav {
position:relative;
}
ul.navul {
padding:0;
margin:0;
background-color:rgba(12,11,11,0.9);
}
.navul li {
list-style-type:none;
display:inline-block;
border-left:1px solid white;
}
.navul li:first-child {
border-left:none;
}
.navul a {
display:inline-block;
padding:10px;
margin:0px;
text-decoration:none;
color:#fff;
border:1px solid blue;
}
Here is a snapshot of what I see:
Little Blocks Of Link
As I decrease the padding in 'a' tag, the size of the blocks go smaller and vice versa. I have already made list-style-type as "none". I have tried making padding:0 and margin:0 on 'li' tag but it doesn't seem to work. I really don't have a clue of what's going on.
Can anyone help?
Try this. I've removed the blue border and instead added the white border around the anchor a tags rather than the li tags
nav {
position:relative;
}
ul.navul {
padding:0;
margin:0;
background-color:rgba(12,11,11,0.9);
}
.navul li {
list-style-type:none;
display:inline-block;
}
.navul a:first-child {
border-left:none;
}
.navul a {
display:inline-block;
padding:10px;
margin:0px;
text-decoration:none;
color:#fff;
border-left:1px solid white;
}
I have a vertical nav menu and i want it to have scroll on y axis,because its for mobile users.Plus that i want menu to show on click of a icon which is absolute positioned to the menu.But when icon get out of the parent div it dissapears.And yes i readed a lot about this problem,and all guys saying that you must set position to relative on parent div,but in my case my parent div is position:fixed;.I tried to make a outer div of this one and set position to relative,but it didn't work.. ;(Here is my code:
/*-----------------------------------------------
Mobile Icon Style.
-----------------------------------------------*/
.mobile-icon{
position:absolute;
display:block;
width: 40px;
z-index:5;
right:-50px
}
.mobile-icon:before{
width: 100%;
font-size:2em;
font-family: "ElegantIcons";
font-weight: bold;
text-align: center;
content: "\64";
}
.mobile-icon:hover{
color:white;
background:black;
}
/*-----------------------------------------------
Mobile Menu Style.
-----------------------------------------------*/
.mobile-menu{
overflow-y:scroll;
position:fixed;
height:100%;
width:70%;
background:white;
z-index:1000;
transform: translate3d(0 ,0 ,0);
transition:transform 0.4s ease;
}
.active-mobile-menu div{
transform:translate3d:(0, 0, 0);
}
.active-mobile-menu .mobile-menu{
transform:translate3d(100% ,0 ,0);
}
.mobile-menu ul{
top:10.2%;
color:black;
text-align:left;
font-weight:bold;
position:relative;
}
.mobile-menu li a {
display:block;
padding: 4% 0;
border-bottom:1px solid black;
}
.mobile-menu > ul> li:hover > a, .mobile-menu > ul> li:hover > .sub-menu > li:hover > a, .mobile-menu > ul .sub-menu .sub-menu > li:hover > a{
background-color: #111;
color: #fff;
}
.mobile-menu ul li ul{
height:100%;
width:100%;
visibility:hidden;
display:none;
opacity:0;
transition:visibility 0s, opacity 0.5s linear;
background:#fff;
border:none;
position:relative;
}
.mobile-menu ul li:hover ul{
display:block;
opacity:1;
visibility:visible;
}
<div class="mobile-menu">
<span class="mobile-icon"></span>
<header class="mobile-header">
<div class="mobile-branding">
<!--My Logo script is here -->
</div>
</header>
<ul class="mobile-menu-ul">
<div class="caret"></div>
<?php wp_nav_menu(array(
'theme_location'=>
This is the menu List
1.
2.
</ul>
</div>
I want to put the logo in-between the navigation menus but I can't figure out how to do it in the theme that I have because I'm having trouble finding it in the backend. I'm sure it's just a matter of reordering something or adding a margin and a space for the photo... Under the header section of the CSS this is the code:
#header { padding:0 20px;margin-bottom:8px;}
#logo { float:left; }
#logo { text-transform:capitalize; padding:35px 0; }
#logo img { max-width:100%; }
#navigation { float:right; margin-right:20px; }
#navigation ul { list-style:none; position:relative; }
#navigation ul li { float:left; padding-left:30px; font-size:12px; display:block; position:relative; font-weight:bold; }
#navigation ul li a { color:#888; padding-bottom:10px; padding-top:35px; display:block; }
#navigation ul li ul { position:absolute; border:1px solid #e9e9e9; display:none; left:15px; padding-bottom:15px; z-index:9999; }
#navigation ul li ul li { min-width:150px; margin-left:15px; margin-right:15px; padding:15px 0 10px 0; border-bottom:1px solid #f6f6f6; font-weight:normal; font-size:10px; }
#navigation ul li ul li:last-child { border:0; padding-bottom:0; }
#navigation ul li ul li a { border:0; display:block; padding:0; }
#navigation li:hover ul { display:block; }
#navigation select { display:none; -webkit-appearance: none; border-radius: 0; }
#navigation ul li#magic-line { position: absolute; left: 0; width: 100px; height: 4px; padding-left:0; display:none; }
I suppose u are using wordpress theme ? If so, each li has its own classes. So you should create one "empty" menu, and add it as background of that link, you can make link to be home page. Text you can hide with text-indent:-9999px;
If u have exact link, i can be more helpful, check how i pulled it out here: http://itsgoran.com/cider
Update:
code should be like this:
li#menu-item-15 {
background-image: url(http://www.new.sheisbiddy.com/wp-content/uploads/2015/11/SHEISBIDDYmainlogoandslogan1.png);
width: 470px;
height: 130px;
background-repeat: no-repeat;
text-indent: -9999px;
}
but i suggest firstly to create smaller logo image, then use that image for this, and ofcourse add smaller width and height which would be width/height of that smaller image.
I have a drop down menu bar. But it is always behind my content no matter how high I set the z-index of the bar or if I set the z-index of my content to -1. Can anybody help?
I did set the z-index to 500 where I do the hover of my navigation top menu but no change. Could it be because of the reset code I use in the beginning of my CSS code?
Here is my CSS Code:
/*navigation.xhtml; author: Mica */
#navigation {
float:left;
width:100%;
height:18px;
margin:15px 0 25px;
}
#navigation ul {
list-style-type:none;
list-style-image:none;
padding:0px;
float:left;
width: 100%;
}
#navigation li.topmenu {
float:left;
width:170px;
}
.topmenu a {
float:left;
width:100%;
text-align:center;
}
.topmenu ul {
float:left;
display:none;
width:100%;
}
.topmenu a, .submenu a, .topmenu:hover .submenu a {
padding:3px 0;
border:1px solid #C27000;
color:#FFFFFF;
font-weight:bold;
text-decoration:none;
background-color:#FF8C00;
margin:0;
font-weight:bold;
}
.submenu a{
width:100%;
clear:both;
postition:absolute;
}
#navigation a:hover, .topmenu.on a, .topmenu:hover a {
background-color:#FFA500;
}
.topmenu:hover ul {
display:block;
z-index:500;
}
#logo a:hover {
opacity:0.8;
}
/*content in basicTemplate.xhtml; author: Mica */
#content {
float:left;
min-height:200px;
margin:0 7px;
}
HAHAAA found it!
z-index only works when a position is declared first: so I need to set in this block a position:
.topmenu:hover ul {
display:block;
z-index:500;
}
Like here:
.topmenu:hover ul {
display:block;
position:relative;
z-index:500;
}
I am having an issue with my site. I have a nav vertical menu that works well in all browsers. I have it set so that when you hover over the image, it shifts position to display the on hover image (like a sprite). However, in IE9 and IE9 in compatibility mode, when I click on one of the links and navigate away from the page and then click back to return to the page, IE puts the on hover image sprite of the last item in the menu as the first image in the menu. It is only when you click the page that this corrects itself. Below is the css.
#nav{
clear:both;
float:left;
width:200px;
margin-right:20px;
}
/*.menu li{
height:28px;
overflow:hidden;
margin-bottom:10px;
}
.menu a:link{
position:relative;
top:0;
}
.menu a:hover{
top: -28px;
}*/
.menu {
position:relative;
margin-left:-10px;
}
.menu li{
/*height:30px;
overflow:hidden;
margin-bottom:10px;*/
margin:10px;
padding:0;
list-style:none;
top:0;
}
.menu li a{
/*height:60px;*/
display:block;
}
.btnPromodirect a{
height:28px;
width:200px;
background:url('../links/promodirect_button.jpg') 200px 0;
}
.btnPromotionmag a{
height:28px;
width:200px;
background:url('../links/promotionmagazine_button.jpg') 200px 0;
}
.btnPromota a{
height:28px;
width:200px;
background:url('../links/promota_button.jpg') 200px 0;
}
.btnPpib a{
height:28px;
width:200px;
background:url('../links/ppib_buton.jpg') 200px 0;
}
.btnPromodirect, .btnPromotionmag, .btnPromota, .btnPpib{
border: none !important;
outline: none !important;
}
.btnPromodirect a:hover, a:active{
background:url('../links/promodirect_button.jpg') 0 -28px;
}
.btnPromotionmag a:hover, a:active{
background:url('../links/promotionmagazine_button.jpg') 0 -28px;
}
.btnPromota a:hover, a:active{
background:url('../links/promota_button.jpg') 0 -28px;
}
.btnPpib a:hover, a:active{
background:url('../links/ppib_buton.jpg') 0 -28px;
}
below is the html
<div id="nav">
<ul class="menu">
<li class="btnPromodirect"></li>
<li class="btnPromotionmag"> </li>
<li class="btnPromota"></li>
<li class="btnPpib"></li>
</ul>
</div>
</div>
I am fairly new to this so any help would be greatly appreciated.
Whereever you are using background like..
background:url('../links/promodirect_button.jpg') 200px 0;
Add no-repeat as well...
background:url('../links/promodirect_button.jpg') 200px 0 no-repeat;
Try this and let me know if it helps ...