Responsive CSS issues on my shop - css

I have some responsive issues on my prestashop site on the top menu block.
Can you please help me solve them?
On media width 500px:
- The height of the categories on the top menu are too high, the "Novedades" item cannot be seen.
On media width 600px:
- The menu subcategories are dropped down automatically by themselves.
On media width 1000px:
- The cloud on "Novedades" item is not set correctly must be a little higher.
Here is the code
/*** ESSENTIAL STYLES ***/
.sf-contener {
clear: both;
}
.sf-right {
margin-right: 14px;
float: right;
width: 7px;
}
.sf-menu, .sf-menu * {
margin: 0;
padding: 0px 0px 0px 0px;
list-style: none;
}
.sf-menu {
margin: 10px 0;
padding:0px 0px 0px 0px;
width:980px;/* 980 */
background: #383838;
/* #media (max-width: 450px) {
.sf-menu {
display: none; } */
}
.sf-menu ul {
position: absolute;
top: -999em;
width: 10em; /* left offset of submenus need to match (see below) */
}
.sf-menu ul li {
width: 100%;
}
.sf-menu li:hover {
visibility: inherit; /* fixes IE7 'sticky bug' */
}
.sf-menu li {
float: left;
position: relative;
top: 0;
/*border-right: 1px solid #777;*/
}
.sf-menu a {
display: block;
position: relative;
color:#fff;
}
.sf-menu li:hover ul,
.sf-menu li.sfHover ul {
left: 0;
/*padding: 0px 0px 0px 0px;
margin: 0px 0px 0px 0px;*/
top: 35px; /* match top ul list item height */
z-index: 99;
width:auto;
}
ul.sf-menu li:hover li ul,
ul.sf-menu li.sfHover li ul {
top: -999em;
}
ul.sf-menu li li:hover ul,
ul.sf-menu li li.sfHover ul {
left: 200px; /* match ul width */
top: 0;
}
ul.sf-menu li li:hover li ul,
ul.sf-menu li li.sfHover li ul {
left: 200px; /* match ul width */
top: 0;
}
ul.sf-menu li li li:hover ul,
ul.sf-menu li li li.sfHover ul {
left: 200px; /* match ul width */
top: 0;
}
/*** DEMO SKIN ***/
.cat-title {
display: none;
}
.sf-menu {
float: left;
margin-bottom: -2em;
width: 100%;
height: 75px;
background: url('http://www.dulcewashitape.com/themes/dulcewashitape/img/cabecera.png') repeat left center;
}
.sf-menu a {
position: relative;
top: 20px;
display:block;
margin-right:2px;
padding: 0 22px 0 20px;
line-height:35px;
border: 10;
text-decoration:none;
text-transform: uppercase;
font-family:Handlee;
font-size: 18px;
font-weight: bold;
}
.sf-menu a, .sf-menu a:visited { /* visited pseudo selector so IE6 applies text colour*/
color: #916e6e;
white-space:nowrap;
}
.sf-menu li ul {
border:1px solid #f1b6b1; box-shadow:2px 2px 4px rgba(0,0,0,0.25);
width:500px;
padding: 0;
margin: 23px 0px 0px 0px;
top:0;
background: white;
}
.sf-menu li li {
background: white;
position: relative;
top: 0;
height:35px;
line-height:35px;
padding: 0;
margin: 0px 0px 0px 0px;
}
.sf-menu li li a {
font-size: 16px;
text-transform: capitalize;
top:0;
}
.sf-menu li li li {
background: white;
width:140px;
}
.sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active {
font-weight: bold;
color: white;
background: url('http://www.dulcewashitape.com/themes/dulcewashitape/img/boton-b.png') no-repeat center 0px;
}
.sf-menu ul li:hover, .sf-menu ul li.sfHover,
.sf-menu ul li a:focus, .sf-menu ul li a:hover, .sf-menu ul li a:active {
background: #eecfd0; //#4e4e4e;
outline: 0;
}
/*** arrows **/
.sf-menu a.sf-with-ul {
padding-right: 2.25em;
min-width: 1px; /* trigger IE7 hasLayout so spans position accurately */
padding-top: 20px;
margin-top: -20px;
}
.sf-sub-indicator {
position: absolute;
display: block;
right: 10px;
top: 1.05em; /* IE6 only */
width: 10px;
height: 35px;
text-indent: -999em;
overflow: hidden;
background: url('../img/arrows-ffffff.png') no-repeat -10px -100px; /* 8-bit indexed alpha png. IE6 gets solid image only */
}
a > .sf-sub-indicator { /* give all except IE6 the correct values */
top: 11px;
background-position: 0 -100px; /* use translucent arrow for modern browsers*/
}
/* apply hovers to modern browsers */
a:focus > .sf-sub-indicator,
a:hover > .sf-sub-indicator,
a:active > .sf-sub-indicator,
li:hover > a > .sf-sub-indicator,
li.sfHover > a > .sf-sub-indicator {
background-position: -10px -100px; /* arrow hovers for modern browsers*/
}
/* point right for anchors in subs */
.sf-menu ul .sf-sub-indicator { background-position: -10px 0; }
.sf-menu ul a > .sf-sub-indicator { background-position: 0 0; }
/* apply hovers to modern browsers */
.sf-menu ul a:focus > .sf-sub-indicator,
.sf-menu ul a:hover > .sf-sub-indicator,
.sf-menu ul a:active > .sf-sub-indicator,
.sf-menu ul li:hover > a > .sf-sub-indicator,
.sf-menu ul li.sfHover > a > .sf-sub-indicator {
background-position: -10px 0; /* arrow hovers for modern browsers*/
}
/*** shadows for all but IE6 ***/
.sf-shadow ul {
background: url('../img/shadow.png') no-repeat bottom right;
padding: 0 8px 9px 0;
-moz-border-bottom-left-radius: 17px;
-moz-border-top-right-radius: 17px;
-webkit-border-top-right-radius: 17px;
-webkit-border-bottom-left-radius: 17px;
}
.sf-shadow ul.sf-shadow-off {
background: transparent;
}
li.sf-search {
background: inherit;
float: right;
line-height: 25px;
background:transparent;
}
li.sf-search input {
-moz-border-radius: 0 5px 5px 0;
padding: 5px 0;
position: relative;
top: 1px;
padding-left: 30px;
margin: 18px 6px 0 0;
background: #fff url('../../../../img/search-zoom3.png') no-repeat left center;
border:1px solid #777;
}
/* hack IE7 */
.sf-menu a, .sf-menu a:visited {height:34px !IE;}
.sf-menu li li {
width:200px;
background:#726f72 !IE;
}
#block_top_menu .category-thumbnail {
display:none;
clear: both;
width: 100%;
float: none; }
#block_top_menu .category-thumbnail div {
float: left;
width: 33.33333%; }
#block_top_menu .category-thumbnail div img {
max-width: 100%; }
#block_top_menu li.category-thumbnail {
padding-right: 0; }
/* Mobile Item */
.sf-menu-phone-item { display:none; }
#sf-menu-phone-trigger { display:none; position:absolute; top:7px; right:0; background:url('http://www.dulcewashitape.com/themes/dulcewashitape/img/icon-mobile-nav.png') top right no-repeat #29addd; width:50px; height:50px; text-indent:-9999px; border-radius:3px;
-webkit-transition: all 0.5s ease 0s;
-moz-transition: all 0.5s ease 0s;
-o-transition: all 0.5s ease 0s;
transition: all 0.5s ease 0s; }
#sf-menu-phone-trigger:hover { background-color:#333; }
#sf-menu-phone-trigger.active { background-position:bottom right; }
#media only screen and (max-width: 999px) {
.sf-menu a, .sf-menu a:visited {font-size:13px;}
}
/* Tablet Only Queries */
#media only screen and (min-width: 531px) and (max-width: 786px) {
.sf-menu a, .sf-menu a:visited {font-size:12px;}
}
/* Phone Only Queries */
#media only screen and (max-width: 530px) {
#sf-menu-header {height:auto; }
#sf-menu-top-nav {margin-left:-2%; margin-right:-2%;}
/*.sf-menu {display:none; } */
.sf-menu {width:100%; height:auto; margin:10px 0 0 0; position:static !important}
.sf-menu li {width:100%; background:#f4f4f4; border-top:1px solid #fff !important; border-bottom:1px solid #999 !important; -webkit-border-radius:0; border-radius:0; }
.sf-menu li:hover {background:#de8686;}
.sf-menu li ul {width:100%; position:static !important; background:#ccc;}
.sf-menu li li {width:100% !important; background:#ccc; }
/*.sf-menu li li li {display:none !important;}*/
.sf-menu-phone-item { display:block; }
#sf-menu-phone-trigger { display:block; }
.sf-search {padding:10px;}
#searchbox {margin-left:15px;}
#searchbox input[type="text"] {width:80%;}
#searchbox input[type="text"]:focus, #searchbox input[type="text"]:hover {width:80%;}
#searchbox .button {width:10%;}
#header_logo { padding-right:50px; text-align:left !important;}
}
And the site is : [www.dulcewashitape.com][1]
Thank you very much I really appreciate your help

On media width 1000px: The "Washi Tape" text is reading the CSS for the a.sf-with-ul class whereas the "Novedades" is executing the CSS for a, and they have differing CSS values.
Take the CSS in a.sf-with-ul and apply it to the a to align your clouds:
ul.sf-menu li a {
padding-right: 2.25em;
min-width: 1px;
padding-top: 20px;
margin-top: -20px;
}
On media width 500px: You have a top:20px; that pushes your text down assigned inside .sf-menu a. Removing it is not an option since it causes misalignment at higher screen widths to your menu. Given this constraint, you can create a special rule using the following to only apply your desired top:5px; if the screen width is less than or equal to 500px
#media screen (max-width: 500px) {
.sf-menu a{
top:5px;
}
}
Unfortunately I do now know how to fix the automatically dropping down menu, goodluck!

Related

css hover drop down parent color

Is there a way to keep the a:hover {color:#ffffff } white color also when i'm hovering the sub menu?
http://jsfiddle.net/Lg7q0nen/
Replace this line:
.sf-menu li a:hover { color:#ffffff; }
By this one:
.sf-menu li:hover a { color:#ffffff; }
/*** ESSENTIAL STYLES ***/
.sf-menu, .sf-menu * {
margin: 0;
padding: 0;
list-style: none;
}
.sf-menu li {
position: relative;
}
.sf-menu ul {
position: absolute;
display: none;
top: 100%;
left: 0;
z-index: 99;
}
.sf-menu > li {
float: left;
}
.sf-menu li:hover > ul,
.sf-menu li.sfHover > ul {
display: block;
}
.sf-menu li { text-transform:uppercase; color:#555a60; }
.sf-menu a {
display: block;
position: relative;
}
.sf-menu ul ul {
top: 0;
left: 100%;
}
.sf-menu i {
position:absolute;
margin:1px 4px;
font-size:18px;
color:#dfd301;
}
.sf-menu i:hover { color:#ffffff; }
/*** DEMO SKIN ***/
.sf-menu {
float: left;
margin-bottom: 1em;
}
.sf-menu ul {
box-shadow: 2px 2px 6px rgba(0,0,0,.2);
min-width: 12em; /* allow long menu items to determine submenu width */
*width: 12em; /* no auto sub width for IE7, see white-space comment below */
}
.sf-menu a {
min-width: 113px;
text-align: center;
padding:20px 16px;
text-decoration: none;
zoom: 1; / IE7 /
}
.sf-menu a {
color: #555a60;
}
.sf-menu li {
/*background: #BDD2FF;*/
white-space: nowrap; /* no need for Supersubs plugin */
*white-space: normal; /* ...unless you support IE7 (let it wrap) */
-webkit-transition: background .2s;
transition: background .2s;
}
.sf-menu li ul li a { padding:10px; text-align:left; color:#ffffff; }
.sf-menu li ul li a:hover { color:#ffffff; }
.sf-menu li ul li { background:#777777; color:#ffffff; }
.sf-menu ul li {
min-width:180px;
text-transform:uppercase; color:#555a60;
}
.sf-menu ul ul li {
background: #9AAEDB;
}
.sf-menu li:hover,
.sf-menu li.sfHover {
background: #b01523;
color:#ffffff;
/* only transition out, not in */
-webkit-transition: none;
transition: none;
}
.sf-menu li:hover a { color:#ffffff; }
/*** arrows (for all except IE7) **/
.sf-arrows .sf-with-ul {
padding-right: 2.5em;
*padding-right: 1em; /* no CSS arrows for IE7 (lack pseudo-elements) */
}
/* styling for both css and generated arrows */
.sf-arrows .sf-with-ul:after {
content: '';
position: absolute;
top: 50%;
right: 1em;
margin-top: -3px;
height: 0;
width: 0;
/* order of following 3 rules important for fallbacks to work */
border: 5px solid transparent;
border-top-color: #dFeEFF; /* edit this to suit design (no rgba in IE8) */
border-top-color: rgba(255,255,255,.5);
}
.sf-arrows > li > .sf-with-ul:focus:after,
.sf-arrows > li:hover > .sf-with-ul:after,
.sf-arrows > .sfHover > .sf-with-ul:after {
border-top-color: white; /* IE8 fallback colour */
}
/* styling for right-facing arrows */
.sf-arrows ul .sf-with-ul:after {
margin-top: -5px;
margin-right: -3px;
border-color: transparent;
border-left-color: #dFeEFF; /* edit this to suit design (no rgba in IE8) */
border-left-color: rgba(255,255,255,.5);
}
.sf-arrows ul li > .sf-with-ul:focus:after,
.sf-arrows ul li:hover > .sf-with-ul:after,
.sf-arrows ul .sfHover > .sf-with-ul:after {
border-left-color: white;
}
<ul class="sf-menu">
<li>home</li>
<li>
blog
<ul>
<li>Option1</li>
<li>Option2</li>
<li>Option3</li>
</ul>
</li>
<li>page
</li>
<li>contact
</li>
</ul>
On line 95 you can do .sf-menu li:hover a
The key is that you are using the :hover on the li and traverse further after it.
Put the :hover on the whole li.
I added this at the end of your css and it seems to work.
.sf-menu > li:hover > a {
color: white;
}
There's probably a better place to put it, but there was a lot of code there...
http://jsfiddle.net/vvf0shvg/

Submenu hides when mouse moves near it

I am trying to make this menu item work but every time I use it, the sub menu hides. Please guide me. Thanks.
EDIT: It is the same issue as this:
CSS Space between menu and submenu
website: http://www.inspuratesystems.com/mntextile
JS Fiddle
#navmenu {
padding-top:30px;
}
.nav-header {
margin: auto;
padding: 0;
display: block;
}
#navmenu ul {
margin: 0px;
padding: 0px;
padding-left: 5px;
}
#navmenu ul li {
list-style-type: none;
display: inline-block;
position: relative;
margin-top: 0px;
padding-top: 15px;
/*
height:60px;
*/
padding-left:10px;
padding-right:10px;
}
#navmenu li a {
font-size: 13px;
color: #FFFFFF;
font-weight: 500;
font-family: 'Raleway', sans-serif;
}
#navmenu li a:hover {
font-size: 13px;
color: #f28c18;
font-weight: 500;
}
#navmenu li a:active {
color: #f28c18;
}
/* Effect 1: Brackets */
#navmenu ul {
-webkit-transition: color 0.3s;
-moz-transition: color 0.3s;
transition: color 0.3s;
margin-top: 5px;
}
#navmenu ul > li::before {
position: absolute;
bottom:65%;
left: 50%;
color: transparent;
/* Removing the balls
content: '•';
*/
/*
text-shadow: 0 0 transparent;
*/
font-size: 1.2em;
-webkit-transition: text-shadow 0.3s, color 0.3s;
-moz-transition: text-shadow 0.3s, color 0.3s;
transition: text-shadow 0.3s, color 0.3s;
-webkit-transform: translateX(-100%);
-moz-transform: translateX(-100%);
transform: translateX(-100%);
pointer-events: none;
margin-left: 5px;
background:#051449;;
}
#navmenu ul > li:hover::before,
#navmenu ul > li:focus::before {
color: #fff;
text-shadow: 10px 0 #fff, -10px 0 #fff;
}
#navmenu ul > li:hover,
#navmenu ul > li:focus {
color: #FFF;
}
#navmenu ul >li ul li::before{ display:none;}
#menu-icon {
display: none;
}
/*SUBMENU*/
#navmenu ul li ul {
position:absolute;width:140px; z-index:999999; padding-left:0; margin-left:0px; display:none;left: 10px; opacity: 0.9;}
/* old= width:120px; */
#navmenu ul li ul li {
float:none; margin:0; text-align:left; background:#FFFFFF ;
padding-right:10px;
padding-left:10px;
padding-top:-10px;
/*
padding:10px 10px;
*/
/*
padding-top:5px;
*/
display:block; border-bottom: 1px solid #333; height:auto; }
#navmenu ul li ul li:hover {
background-color: #0099CC;
}
#navmenu ul > li ul li:hover {
color: white; /* Old browsers */
background-color: #0099CC ;
}
#navmenu ul li ul li a
{ width:100%; margin:0px; display:block; color: #FFFFFF;
}
#navmenu ul li ul li a:hover
{ width:100%; margin:0px; display:block; color: #FFFFFF;
}
#navmenu ul li ul li ul {
left: 100%;
/* sub menus of sub menu's same
margin-top: -32px;
*/
margin-top: -27px;
float: none;
border-left-width: 1px;
border-left-style: solid;
border-left-color: #CCC;
}
#media only screen and (max-width: 768px) {
/*MENU*/
body #menu_wrap {
width: 100%;
}
body #navmenu {
width: 100%;
text-align: center;
}
#navmenu ul li {
list-style-type: none;
display: inline-block;
position: relative;
margin-top: 0px;
padding-top: 15px;
height: auto;
padding-left:10px;
padding-right:10px;
background-color:#051449;
}
/* nav-wrap */
#menu_wrap {
position: relative;
}
/* menu icon */
#menu-icon {
padding: 10px 0px;
cursor: pointer;
font-size: 20px;
display: block!important; /* show menu icon */
}
#menu-icon:hover {
}
/* main nav */
body #navmenu ul.menu {
clear: both;
position: absolute;
top: 50px;
width: 100%;
z-index: 10000;
/*
border: solid 1px #999;
*/
display: none;
margin-top: 5px;
/*
background-color: rgb(51,51,51);
*/
background-color:#051449;
}
body #navmenu ul.menu li {
width: 100%;
clear: both;
float: none;
text-align: center;
padding-top: 6px;
padding-right: 30px;
padding-bottom: 6px;
padding-left: 0px;
/*
border-top-width: 2px;
border-right-width: 2px;
border-bottom-width: 2px;
border-left-width: 2px;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
*/
}
body #navmenu ul > li:hover {
background: #051449 !important;
}
body #navmenu ul.menu li ul li {
background:#051449!important;
width: 100%;
border: none;
}
body #navmenu ul.menu li ul li:hover {
background:#051449!important;
}
body #navmenu ul.menu a, body #topmenu ul.menu ul a {
background: #051449!important;
display: inline;
padding: 0;
border: none;
}
body #navmenu ul.menu a:hover, body #topmenu ul.menu ul a:hover {
background: #051449!important;
}
/* dropdown */
body #navmenu ul.menu ul {
width: auto;
position: static;
display: block;
border: none;
background: inherit;
margin-top: 0px;
}
body #navmenu ul.menu ul li {
}
}
Add in the css:
#navmenu ul li ul {
margin-top: 0;
}
So the space between the elements is removed.
You can use it -
Demo
nav ul li {
float: left;
position:relative
}
nav ul ul {
background-color:#fff;
border-radius: 0px;
padding: 0;
position: absolute;
top: 100%;
box-shadow: 0px 0px 9px rgba(0,0,0,0.15);
margin-top:5px;
}

How to stick a background behind the navbar?

I have a problem here.
I'm using wordpress and I was confused.
How to stick background behind the nav bar?.
I activated LowerMedia Sticky.js menu's plugin, then I want to change my navbar background color. I try to add a background: #000; in #navigation. It's look okay, but when I scroll down, the navigation background is not move. There's only the navigation text that moved. I try to move background: #000; to #navigation .sf-menu a but the background is only appear around the text, even it move with the text when I scroll down. I don't know what to do now. Please help me. Thanks before.
This is my site : vitraprawira.net
This is my final navbar css code:
/* Main Navigation
================================================== */
/*hide responsive nav*/
#top-bar .selector, #navigation .selector { display: none; }
/*core*/
.sf-menu, .sf-menu * { margin: 0; padding: 0; list-style: none; }
.sf-menu { line-height: 1.0 }
.sf-menu ul { position: absolute; top: -999em; width: 180px; }
.sf-menu ul li { width: 100% }
.sf-menu li:hover { visibility: inherit }
.sf-menu li { float: left; position: relative; }
.sf-menu a { display: block; position: relative; }
.sf-menu li:hover ul, .sf-menu li.sfHover ul { left: 0px; top: 30px; z-index: 99; }
ul.sf-menu li:hover li ul, ul.sf-menu li.sfHover li ul { top: -999em }
ul.sf-menu li li:hover ul, ul.sf-menu li li.sfHover ul { left: 180px; top: 1px; }
/*styling*/
#navigation-wrap { position: relative; display: block; }
#navigation { margin-left: 170px; margin-right: auto; position: relative; height: 55px; transparent: none; }
#navigation .sf-menu > li:hover > ul, .sf-menu li.sfHover > ul { top: 50px }
#navigation ul.sf-menu li li:hover ul, ul.sf-menu li li.sfHover ul, ul.sf-menu li li:hover ul, ul.sf-menu li li.sfHover ul { left: 200px; top: 0; }
#navigation .sf-menu a { font-size: 1.000em; height: 55px; line-height: 55px; color: #fff; background: #000 url("images/vintage.png"); }
#navigation .sf-menu > li > a { border-radius: 2px; -moz-border-radius: 2px; -webkit-border-radius: 2px; }
#navigation .sf-menu li { float: left; position: relative; }
#navigation .sf-menu > li { background: url("images/dash.png") right center no-repeat; margin-right: 20px; padding-right: 20px; }
#navigation .sf-menu > li:last-child { margin: 0; padding: 0; }
#navigation .sf-menu > li > a:hover { color: #fff }
#navigation .sf-menu > .current-menu-item > a { color: #7094DB }
#navigation .sf-menu > li.sfHover > a { color: #fff }
/*drop-down styles*/
#navigation .sf-menu ul { position: absolute; nowhitespace: afterproperty; top: -999em; width: 200px; z-index: 9999; left: 0; border: 1px solid #ddd; box-shadow: 0 0 8px rgba(0,0,0,0.08); }
#navigation .sf-menu ul > li:last-child { -webkit-border-bottom-right-radius: 2px; -webkit-border-bottom-left-radius: 2px; -moz-border-radius-bottomright: 2px; -moz-border-radius-bottomleft: 2px; border-bottom-right-radius: 2px; border-bottom-left-radius: 2px; }
#navigation .sf-menu ul li { background: #000; border-bottom: 1px solid rgba(0,0,0,0.05); }
#navigation .sf-menu ul li:first-child { border-top: 0 }
#navigation .sf-menu ul li:last-child { border-bottom: 0 }
#navigation .sf-menu ul a { display: block; padding: 10px; color: #fff; height: auto; margin: 0px; border: 0px; line-height: 1.8em; font-size: 0.923em; text-shadow: none; }
#navigation .sf-menu ul li > a:hover { color: #7094DB; background: #2D3B58; }
If you're wanting the color/image to appear behind the entire menu block, then you're localizing the background too close to the anchor element.
Just do this: #navigation {background: #ccc;} or whatever color you want.

superfish menu styling issue

Im trying to style my superfish menu in my Wordpress theme. Im trying to elimate the gap between the dropdown when on hover.
As you can see from the picture there is a small gap.
I have tried to edit the below code which i believe is applicable to the section in question. However when applying a negative margin its making the options overlap as shown.
Im currently editting the below code:-
.sf-menu li li {
background: #193030;
}
however placing a margin-top: -10px; produces this:-
Your help and advice is appreciated.
thanks
EDIT
Please see full CSS of superfish :)
/*** ESSENTIAL STYLES ***/
.sf-menu, .sf-menu * {
margin: 0;
padding: 0;
list-style: none;
}
.sf-menu {
line-height: 1.0;
}
.sf-menu ul {
position: absolute;
top: -999em;
width: 10em; /* left offset of submenus need to match (see below) */
}
.sf-menu ul li {
width: 100%;
}
.sf-menu li:hover {
visibility: inherit; /* fixes IE7 'sticky bug' */
}
.sf-menu li {
float: left;
position: relative;
}
.sf-menu a {
display: block;
position: relative;
}
.sf-menu li:hover ul,
.sf-menu li.sfHover ul {
left: 0;
top: 2.5em; /* match top ul list item height */
z-index: 99;
}
ul.sf-menu li:hover li ul,
ul.sf-menu li.sfHover li ul {
top: -999em;
}
ul.sf-menu li li:hover ul,
ul.sf-menu li li.sfHover ul {
left: 10em; /* match ul width */
top: -10;
}
ul.sf-menu li li:hover li ul,
ul.sf-menu li li.sfHover li ul {
top: -999em;
}
ul.sf-menu li li li:hover ul,
ul.sf-menu li li li.sfHover ul {
left: 10em; /* match ul width */
top: 0;
}
/*** DEMO SKIN ***/
.sf-menu {
float: left;
margin-bottom: 1em;
}
.sf-menu a {
border-right: 1px solid #193030;
padding: .75em 1em;
text-decoration:none;
font: 11.5px Open Sans;
text-transform: uppercase;
color: #fff;
}
.sf-menu a, .sf-menu a:visited { /* visited pseudo selector so IE6 applies text colour*/
color: #fff;
}
.sf-menu li {
background: transparent;
}
.sf-menu li a {color: #fff;}
.sf-menu li li {
background: #193030;
margin-top: -0px;
}
.sf-menu li li a:hover {background-color: #0a1c1c;}
.sf-menu li li li {
background: #9AAEDB;
}
.sf-menu li:hover, .sf-menu li.sfHover,
.sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active {
background: #193030;
outline: 0;
}
/*** arrows **/
.sf-menu a.sf-with-ul {
padding-right: 2.25em;
min-width: 1px; /* trigger IE7 hasLayout so spans position accurately */
}
.sf-sub-indicator {
position: absolute;
display: block;
right: .75em;
top: 1.5em; /* IE6 only */
width: 10px;
height: 10px;
text-indent: -999em;
overflow: hidden;
background: url('images/arrows-ffffff.png') no-repeat -10px -100px; /* 8-bit indexed alpha png. IE6 gets solid image only */
}
a > .sf-sub-indicator { /* give all except IE6 the correct values */
top: 1.0em;
background-position: 0 -100px; /* use translucent arrow for modern browsers*/
}
/* apply hovers to modern browsers */
a:focus > .sf-sub-indicator,
a:hover > .sf-sub-indicator,
a:active > .sf-sub-indicator,
li:hover > a > .sf-sub-indicator,
li.sfHover > a > .sf-sub-indicator {
background-position: -10px -100px; /* arrow hovers for modern browsers*/
}
/* point right for anchors in subs */
.sf-menu ul .sf-sub-indicator { background-position: -10px 0; }
.sf-menu ul a > .sf-sub-indicator { background-position: 0 0; }
/* apply hovers to modern browsers */
.sf-menu ul a:focus > .sf-sub-indicator,
.sf-menu ul a:hover > .sf-sub-indicator,
.sf-menu ul a:active > .sf-sub-indicator,
.sf-menu ul li:hover > a > .sf-sub-indicator,
.sf-menu ul li.sfHover > a > .sf-sub-indicator {
background-position: -10px 0; /* arrow hovers for modern browsers*/
}
/*** shadows for all but IE6 ***/
.sf-shadow ul {
background: url('../images/shadow.png') no-repeat bottom right;
padding: 0 8px 9px 0;
-moz-border-radius-bottomleft: 17px;
-moz-border-radius-topright: 17px;
-webkit-border-top-right-radius: 17px;
-webkit-border-bottom-left-radius: 17px;
}
.sf-shadow ul.sf-shadow-off {
background: transparent;
}
this has now been fixed thanks to the lovely Florian..
I needed to amend
.sf-menu li.sfHover ul {
left: 0;
top: 2.1em; /* match top ul list item height */
z-index: 99;
}
This stated how far the UL was from the top.
I hope this knowledge helps others too.

Want nav menu over background image on splash page but it moves around on various monitors

I'm pretty sure this is an easy fix and I am simply too in experienced to figure it out. I'm building a site, using WP, but the home page is simply a background image with a vertical nav menu. I don't now how to make the menu stay in the same place for all browsers and windows. It looked good on my screen, then I found the nav pane was in a completely different place on my husband's monitor. I believe it has to do with position and display and margins, but I am getting more lost as I read up on these and I just want someone to tell me the code.
The page is at www.sydneyjanebaily.com
So far the code for the whole page is as follows:
body {
background-image:url(http://www.sydneyjanebaily.com/wp-content/themes/twentyeleven/images/open-book.png);
background-repeat:no-repeat; background-attachment:fixed;
background-position:center;
}
menu { display: block; }
access div { display: block; margin-left:890px; margin-right:auto; margin-top:200px; width: 235px; }
/************* Navigation **********/
nav#access ul, nav#access li.pagenav { display: block; list-style:
none; }
nav#access ul li a span, nav#access ul li.page_item a span { position:
absolute; right: 100%; top: 2px; width: 15px; height: 100%;
background-image: url(../images/nav-shadow.png); background-position:
right top; background-repeat: repeat-y; }
nav#access ul li a, nav#access ul li a:visited, nav#access ul
li.page_item a, nav#access ul li.page_item a:visited { display:
block; padding: 8px 10px 8px 30px; color: white; font: 150%
"EBGaramondSC", "Palatino", "Palatino Linotype","Book Antiqua",
Georgia, serif; text-decoration: none; /*background-color:
aba000; */ margin: 5px 0 7px 0; position: relative; width: 235px; /font-variant: small-caps;/ }
nav#access ul li a:hover, nav#access ul li a:focus, nav#access ul
li.page_item a:hover, nav#access ul li.page_item a:focus{ color:
FF0000; }
nav#access li a:hover span { background-color: #666; } nav#access ul
li a em { font-size: 87.50%; } nav#access ul li:nth-child(5n-4) a,
nav#access ul li:nth-child(5n-4) a span { ; } nav#access ul
li:nth-child(5n-3) a, nav#access ul li:nth-child(5n-3) a span { ; }
nav#access ul li:nth-child(5n-2) a, nav#access ul li:nth-child(5n-2) a
span { ; } nav#access ul li:nth-child(5n-1) a, nav#access ul
li:nth-child(5n-1) a span { ; } nav#access ul li:nth-child(5n-5) a,
nav#access ul li:nth-child(5n-5) a span {; } -->
nav#access ul li ul li span { position: absolute; right: 100%; top: 0;
width: 20px; height: 100%; left: 2px; margin-right: 15px; overflow:
visible; } nav#access ul li ul li:nth-child(odd) a { background:
none; color: #EEE8AA; font-size: smaller; margin: 3px 20px 5px 20px;
min-height: 20px; width: 210px; padding: 2px 0 2px 20px; } nav#access
ul li ul li:nth-child(odd) a:hover, nav#access ul li ul
li:nth-child(odd) a:focus { background: none; color: #ADFF2F;
font-size: smaller; left: 15px; padding: 2px 30px 2px 25px; }
nav#access ul li ul li:nth-child(odd) a span { background:
url(../images/sub-menu2.png) -5px 0px no-repeat; width: 30px; }
nav#access ul li ul li:nth-child(even) a { background: none; color:
3B3C1D; font-size: smaller; margin: 3px 20px 5px 20px; min-height: 20px; width: 210px; padding: 2px 0 2px 20px; } nav#access ul li ul
li:nth-child(even) a:hover, nav#access ul li ul li:nth-child(even)
a:focus { background: none; color: #FF4500; font-size: smaller; left:
15px; padding: 2px 30px 2px 25px; } nav#access ul li ul
li:nth-child(even) a span { background: url(../images/sub-menu2.png)
-5px 0px no-repeat; width: 30px; }
nav#access ul li ul li ul li:nth-child(odd) a { background: none;
color: #FFD700; font-size: smaller; margin: 3px 20px 5px 30px;
min-height: 20px; width: 200px; padding: 2px 0 2px 20px; } nav#access
ul li ul li ul li:nth-child(odd) a:hover, nav#access ul li ul li ul
li:nth-child(odd) a:focus { background: none; color: #EEE8AA;
font-size: smaller; left: 25px; padding: 2px 30px 2px 25px; }
nav#access ul li ul li ul li:nth-child(odd) a span { background:
url(../images/sub-menu.png) -10px 0px no-repeat; width: 30px; }
nav#access ul li ul li ul li:nth-child(even) a { background: none;
color: #3B3C1D; font-size: smaller; margin: 3px 20px 5px 30px;
min-height: 20px; width: 200px; padding: 2px 0 2px 20px; } nav#access
ul li ul li ul li:nth-child(even) a:hover, nav#access ul li ul li ul
li:nth-child(even) a:focus { background: none; color: #7FFFD4;
font-size: smaller; left: 25px; padding: 2px 30px 2px 25px; }
nav#access ul li ul li ul li:nth-child(even) a span { background:
url(../images/sub-menu.png) -10px 0px no-repeat; width: 30px; }
nav#access ul li a:hover:active, nav#access ul li ul li
a:hover:active, nav#access ul li ul li ul li a:hover:active,
nav#access ul li a:focus:active, nav#access ul li ul li
a:focus:active, nav#access ul li ul li ul li a:focus:active { color:
00CCFF; left: 1px; top: 1px;}
/* Singular navigation */
nav-single { float: right; position: relative; top: -0.3em; text-align: right; z-index: 1; }
nav-single .nav-previous,
nav-single .nav-next { float: none; width: auto; }
nav-single .nav-next { padding-left: .5em; }
img.book {
/* Set rules to fill background */
min-height: 100%;
min-width: 1000px;
/* Set up proportionate scaling */
height: auto;
/* Set up positioning */
top: 0;
left: 0;
display: block;
margin-left: auto;
margin-right: auto;
text-align: center;
}
</style>
<!-- <img class="book"src="<?php bloginfo('template_directory');?>/images/open-book.png" alt="xxx"
width="880" height="xxx" /> -->
<?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff. */ ?>
<!-- <div class="skip-link"><a class="assistive-text" href="#content" title="<?php esc_attr_e( 'Skip to primary content',
'twentyeleven' ); ?>">
"> -->
'primary' ) ); ?>
I am puzzled that when I inspect an element using Firefox developer tool, it still says inline element for things I've marked as block.
Basically, I can put the nav pane where I want using px but it only looks right on my screen. I think I need percentages, but that is beyond me. Please help.
Thanks,
Sydney
Try replacing this:
#access div {
display: block;
margin-left:890px;
margin-right:auto;
margin-top:200px;
width: 235px;
}
with this:
#access div {
position: absolute;
top: 20%;
left: 50%;
}
It works well on my monitor no matter how I squash or stretch the screen, and it should work for you as well. Good luck!

Resources