As you'll see in the screenshot linked to below, I'm encountering strange behaviour when using Chrome 39.0.2171.95. A smaller than 1px gap appears between the styled list items. It looks fine in Firefox and IE.
I hadn't noticed it until I started using a device with retina display, so I would be interested to find out how many others see the same as me.
It doesn't use inline-block, and removing the space between each <li> is not possible as the three-tiered menu is generated by WordPress (and I doubt it is a solution here). Using negative margins hides the gap, but as a workaround and not a solution it causes other issues (it moves the sub-menus out of place).
Screenshot: http://i58.tinypic.com/m9rkmf.jpg
Link: http://www.tolkiensociety.org/
This is the current CSS:
#mainmenu {
background:#333333;
position:absolute;
bottom:0;
width:960px;
}
#mainmenu.fixed {
position:fixed;
top:0;
z-index:100;
height:43px;
}
#mainmenu > ul {
padding-left:124px;
}
#mainmenu ul {
height:43px;
list-style:none;
position:relative;
}
#mainmenu ul li {
float:left;
}
#mainmenu ul li a {
display:block;
padding:12px 10px;
border-bottom:4px solid #00A33E;
color:#fefefe;
text-transform:uppercase;
text-decoration:none;
font-size:14px;
font-weight:300;
height:15px;
}
#mainmenu ul li:hover > a {
background:#222222;
}
#mainmenu .menu-item-1128 > a {
border-bottom: 4px solid #82c4e5;
}
#mainmenu .menu-item-644 > a {
border-bottom: 4px solid #e33417;
}
#mainmenu .menu-item-62 > a {
border-bottom: 4px solid #78bf32;
}
#mainmenu .menu-item-91 > a {
border-bottom: 4px solid #00A33E;
}
#mainmenu .menu-item-81 > a {
border-bottom: 4px solid #d99f3c;
}
#mainmenu .menu-item-739 > a {
border-bottom: 4px solid #F1654F;
}
#mainmenu ul ul {
display:none;
position:absolute;
top:39px;
z-index:9999;
min-width:200px;
}
#mainmenu ul li:hover > ul {
display:block;
}
#mainmenu ul ul li {
float:none;
position:relative;
}
#mainmenu ul ul li a {
padding:12px 10px;
border:0;
color:#fefefe;
text-transform:none;
text-decoration:none;
font-size:14px;
font-weight:400;
height:15px;
white-space:nowrap;
background-color:#222;
}
#mainmenu ul ul li a:hover {
background-color:#111;
}
#mainmenu ul ul ul {
position:absolute;
left:100%;
top:0;
}
#mainmenu ul ul li:hover > a {
background:#111;
}
#mainmenu ul ul ul li a {
background-color:#111;
}
#mainmenu ul ul ul li a:hover {
background-color:#000;
}
Resset the UL and LI as shown below to bring the padding and margin of the listed to zero.
ol, ul, li {
margin: 0;
padding: 0;
}
Note: Add the above to the very top of your CSS file. That way, unless if otherwise set, the padding and margin will be zero.
Is your browser zoom at 100%? I recently had a similar case, and I found out the little gap was because the page was slightly zoomed in.
Related
I just tried to remove the MagicLine that was built into my Wordpress theme by taking out the CSS code that I'll put below. It worked and the line is gone but now my navigation is all jumpy as you can see at the site: http://sheisbiddy.com/home/ Is there a better way to remove the line (I can't seem to find it in the piles of code that came with the theme) or anyway to get the menu back to normal? Thanks!
#navigation ul li#magic-line { position: absolute; left: 0; width: 100px; height: 4px; padding-left: 0; display: none; }
This is what is left for the navigation CSS:
#header {height: 100px; padding-top: 20px; margin: 0 auto; }
#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:inline; position:relative; font-weight:bold; }
#navigation ul li a { color:#888; padding-bottom:10px; padding-top:35px; display:inline; }
#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:inline; padding:0; }
#navigation li:hover ul { display:inline; }
#navigation select { display:none; -webkit-appearance: none; border-radius: 0; }
you have an errors in you CSS which causes the navigation to behave this way...
in style.dynamic.php file :
Lines : 94,96,104
#tagline { background-color:; }
#navigation ul li { padding-bottom:px; }
#navigation ul li a { padding-top:px; }
I have set up a site with Drupal 7, using the theme called "Professional Theme". I've found problem with text-overlapping on the main menu. There are two rows in my top menu bar. I've found the drop-down menu text has overlapped with the text on the text on the 2nd row of the menu. And I can't click on the links on that drop-down menu as it would simply disappear when I move the cursor downward. May anyone tell me what's wrong with it and how to fix it?
#main-menu {
min-height:35px;
box-shadow:0 0 3px #999;
background:#000033;
background:-moz-repeating-linear-gradient(#666699, #000033 35px);
background:-webkit-repeating-linear-gradient(#666699, #000033 35px);
background:-o-repeating-linear-gradient(#666699, #000033 35px);
background:-ms-repeating-linear-gradient(#666699, #000033 35px);
background:repeating-linear-gradient(#666699, #000033 35px);
}
#main-menu ul {
float:left;
padding:0;
margin:0;
max-width:75%;
list-style:none;
font-family:Arial, Helvetica, sans-serif;
font-size:13px;
font-weight:bold;
}
#main-menu li {
position:relative;
float:left;
padding:0;
margin:0;
line-height:35px;
z-index:100;
list-style-image:url(none);
}
#main-menu li li{
line-height:13px;
}
#main-menu ul li:first-child {
padding-left:0;
}
#main-menu a {
display:block;
padding:0 20px;
color:#f0f0f0;
text-align:center;
text-decoration:none;
}
#main-menu a:hover,
#main-menu li > a.active {
background:#3366cc;
background:-moz-linear-gradient(#3399ff,#000033);
background:-webkit-linear-gradient(#3399ff,#000033);
background:-o-linear-gradient(#3399ff,#000033);
background:-ms-linear-gradient(#3399ff,#000033);
background:linear-gradient(#3399ff,#000033);
color:#fff;
text-decoration:none;
}
#main-menu li > a.active {
background:#cc66ff;
background:-moz-linear-gradient(#cc66ff,#000033);
background:-webkit-linear-gradient(#cc66ff,#000033);
background:-o-linear-gradient(#cc66ff,#000033);
background:-ms-linear-gradient(#cc66ff,#000033);
background:linear-gradient(#cc66ff,#000033);
}
.drop-down-toggle {
position:absolute;
top:7px;
right:16px;
display:none;
width:20px;
height:20px;
border-radius:15px;
background:#000033;
background:-moz-linear-gradient(#666699,#000033);
background:-webkit-linear-gradient(#666699,#000033);
background:-o-linear-gradient(#666699,#000033);
background:-ms-linear-gradient(#666699,#000033);
background:linear-gradient(#666699,#000033);
border:#aaa 3px solid;
}
.drop-down-arrow {
display:block;
width:0;
height:0;
margin:8px 0 0 5px;
border-top:5px solid #aaa;
border-left:transparent 5px solid;
border-right:transparent 5px solid;
}
#main-menu li li {
float:none;
min-width:190px;
padding:0;
margin:0;
}
#main-menu li li a {
min-width:190px;
margin:0;
background:#555;
border-top:#5f5f5f 1px solid;
font-size:13px;
line-height:33px;
text-align:left;
overflow:hidden;
}
#main-menu li li li a {
min-width:260px;
margin:0;
background:#555;
border-top:#5f5f5f 1px solid;
font-size:13px;
line-height:33px;
text-align:left;
overflow:hidden;
}
#main-menu li li:first-child > a {
border-top:none;
}
#main-menu li li a:hover {
background:#444;
}
#main-menu li ul {
display:none;
position:absolute;
z-index:9999;
min-width:190px;
height:auto;
padding:0;
margin:0;
box-shadow:0 0 3px #333;
}
#main-menu li ul ul {
margin:-33px 0 0 190px !important;
}
#main-menu li:hover > ul,
#main-menu li li:hover > ul,
#main-menu li li li:hover > ul {
display:block;
}
#main-menu .nav-toggle {
display:none;
}
#main-menu ul li.leaf, #main-menu ul li.expanded, #main-menu ul li.collapsed {
list-style:none;
}
#main-menu ul.menu li {
margin: 0;
}
#main-menu li.expanded, #main-menu li.collapsed, #main-menu li.leaf {
margin: 0;
padding: 0;
}
Actually the css here is based on the original css for main menu in the Professional Theme.
if you open the following link
http://dev.scopedesign.com/client/nyfarmersmarket_02/
you find an navigation bar if you go on "ABOUT US" you will see a drop down..
then you se the problem in drop down
now i want to give you a little idea from how i make this..
I am working on joomla CMS, & i do some changes in navigation module to get my style now the follwing CSS i used for this.. the problem is it is displaying the .parent.active a
background in drop downs i dont want that for this purpose i made .parent.active a ul
but it doesnt work..
you can check this how it works by inspect element in the browser.
.parent.active a{
background-image:url(../images/selected.png);
background-repeat:repeat-x;
padding-top:13px;
padding-bottom:13px;
}
.parent.active a ul{
background-image:none !important;
background-repeat:none;
padding-top:0px !important;
padding-bottom:0px !important;!
}
.menusan
{
/* Use these parameters to positions your menu. */
position: absolute;
// left: 10px;
}
.menusan, .menusan li, .menusan li ul { /* all lists */
padding: 0;
margin: 0;
// list-style: none;
display:block;
float:left;
}
.menusan li a{
padding-left:20px;
padding-right:18px;
}
.menusan li a:hover{
background-image:url(../images/selected.png);
background-repeat:repeat-x;
padding-top:13px;
padding-bottom:13px;
}
.menusan li{ /* all list items */
padding-top:11px;
padding-bottom:11px;
// padding-left:20px;
// padding-right:18px;
-moz-border-right:#537d28 groove 2px;
border-right:#7cb43f groove 2px;
[border-right:#537d28 groove 2px;
border-right:#7cb43f groove 2px;/
border-right:#7cb43f groove 2px;]
}
.menusan li ul { /* second-level lists */
//top:35px;
margin-top:13px;
float:left;
position: absolute;
border: none;
left: -98%; /* Use left instead of display to hide menus; display: none isn’t read by screen readers. */
}
.menusan li ul li{
display:list-item;
float:none;
border: none;
background-color:#537d28;
color:#fff;
//padding:10px 10px 24px 10px;
}
.menusan li ul li:hover{
display:list-item;
float:none;
background-color:#96c73d;
}
.menusan li ul li a{
display:block;
float:left;
}
.menusan li ul li a:hover{
display:block;
float:left;
background-color:#96c73d;
}
.menusan li:hover ul, .menusan li.sfhover ul { /* lists nested under hovered list items */
left: auto; /* change is to 10px, 20px, etc for indenting the sub menu */
border: none;
display:block;
float:left;
}
/* **************** Dropdown Menu styling end here ***************/
One thing i specialy want to let you know guys that it is difficult to make div in it or cheange style name because it is a dynamic module.
Cleaned up and fixed your CSS, try this:
.navigation {
background-color:#537D28;
color:#fff;
float:left;
font-family:Arial, Helvetica, sans-serif;
font-size:11px;
height:40px;
margin-bottom:0.6em;
width:100%;
}
.menusan {
margin: 0;
list-style-type: none;
font-weight:700;
float: left;
color:#fff;
}
.menusan > li {
margin:0;
float: left;
border-right:1px groove #7cb43f;
position:relative;
}
.menusan li a {
display:block;
height:40px;
line-height:40px;
padding:0 25px;
text-decoration:none;
color:#fff;
}
.menusan .active {
background: url("http://dev.scopedesign.com/client/nyfarmersmarket_02/templates/nyfm/images/selected.png") repeat-x center center;
}
.menusan li a:hover {
background: url("http://dev.scopedesign.com/client/nyfarmersmarket_02/templates/nyfm/images/selected.png") repeat-x center center;
}
.menusan li.parent ul {
position:absolute;
z-index:9999;
top:40px;
left:0;
display:none;
background-color:#537D28;
}
.menusan li.parent:hover ul {
display:block;
}
.menusan li.parent ul a {
float:left;
}
.menusan li.parent ul a:hover {
background-color:#70A835;
}
.menusan li.parent ul a {
width:55px;
}
I am so close to launching my first Magento project, and the final leg has just been one CSS hurdle after another… mostly with IE.
This last one popped up just after fixing 5 other things, and has not been an issue until now.
In IE, my top nav links (2) are appearing about 20px too high until you hover over them and then they jump into place.
Navigation CSS:
.nav-container { background:#ffffff url(../images/bkg_nav0.jpg) 50% 0 repeat-y; }
#nav { width:918px; margin:0 auto; padding:0 16px; font-size:13px; }
#nav li { position:relative; text-align:left; }
#nav li.over { z-index:998; }
#nav a,
#nav a:hover { display:block; line-height:1.3em; text-decoration:none;}
#nav span { display:block; cursor:pointer; white-space:nowrap; }
#nav li ul span {white-space:normal; }
#nav ul li.parent a { background:url(../images/bkg_nav2.gif) 100% 100% no-repeat; }
#nav ul li.parent li a { background-image:none; }
/* 0 Level */
#nav li { float:left; }
#nav li.active a { color:#8751b0; }
#nav a { float:left; padding:5px 12px 6px 8px; color:#000000; font-weight:bold; display: block;}
#nav li.over a,
#nav a:hover { color:#8751b0; display: block;}
/* 1st Level */
#nav ul li,
#nav ul li.active { float:none; margin:0; padding-bottom:1px; background:#ecf3f6 url(../images/bkg_nav1.gif) 0 100% repeat-x; }
#nav ul li.last { background:#ecf3f6; padding-bottom:0; }
#nav ul a,
#nav ul a:hover { float:none; padding:0; background:none; }
#nav ul li a { font-weight:normal !important; }
As you can see, there are no :hover properties with margins that are overriding the original state. I just can't figure this one out.
I have tried Firebug but I just can't relate it to the IE issues. It renders fine in FF...and the IE 'Developer Tools' just can't compare to Firebug...
Please, any help is appreciated!
I had the same issue with a menu and found that removing the "display: block;" fixed this issue with IE.
i have this site:
www.yoursdproperty.com
i need the top menu items HOME, BUYING PROPERTY, SELLING PROPERTY ETC...
to take up 100% of the width of the top bar. if i add more items, i went them to size accordingly.
here is the CSS associated with this menu bar. is there something i can change here to do that?
/* Moo Menus */
#cssmenu_moo_menu
{ padding:0;
margin:0; }
#cssmenu_moo_menu a
{ float:left;
text-decoration:none;
display:block;
cursor:pointer;
height:35px;
font-size:14px;
font-weight: bold;
line-height:35px;
padding:0 15px;
overflow:hidden;
border-right:1px solid #0d85c9; }
#cssmenu_moo_menu li li a
{ font-weight:bold;
font-size:12px;
border-right:none;
padding:0; }
#cssmenu_moo_menu ul
{ height:35px;
float:left;
list-style:none;
margin:0; }
#cssmenu_moo_menu
{ background:#006198 url(../images/moomenu.png) repeat-x 50% top;
height:35px;
float:left;
list-style:none;
margin:0;
padding:0; }
#cssmenu_moo_menu li li
{ padding:0;
background:none; }
#cssmenu_moo_menu ul ul a
{ color:#000;
display:block;
text-decoration:none;
width:275px;
text-transform:none; }
#cssmenu_moo_menu li
{ float:left;
padding-left:0;
height:35px;
background:transparent; }
#cssmenu_moo_menu ul li
{ position:relative; }
#cssmenu_moo_menu li ul
{ z-index:99;
top:35px;
position:absolute;
left:-999em;
height:auto;
font-weight:normal;
margin:0;
border:0 solid #ddd;
padding:0; }
#cssmenu_moo_menu ul
{ padding:0;
margin-top:0; }
#cssmenu_moo_menu li li
{ float:left;
padding:0;
margin:0;
height:35px;
width:275px; }
#cssmenu_moo_menu li ul ul
{ margin:-25px 0 0 275px; }
#cssmenu_moo_menu li:hover ul ul,#cssmenu_moo_menu li:hover ul ul ul,#cssmenu_moo_menu li:hover ul ul ul ul,#cssmenu_moo_menu li.sfhover ul ul,#cssmenu_moo_menu li.sfhover ul ul ul,#cssmenu_moo_menu li.sfhover ul ul ul ul
{ position:absolute;
left:-999em; }
#cssmenu_moo_menu li:hover ul,#cssmenu_moo_menu li li:hover ul,#cssmenu_moo_menu li li li:hover ul,#cssmenu_moo_menu li li li li:hover ul,#cssmenu_moo_menu li.sfhover ul,#cssmenu_moo_menu li li.sfhover ul,#cssmenu_moo_menu li li li.sfhover ul,#cssmenu_moo_menu li li li li.sfhover ul
{ position:absolute;
left:0; }
#cssmenu_moo_menu ul ul
{ width:275px;
background:#006198; }
#cssmenu_moo_menu ul ul ul
{ width:275px;
padding-bottom:0; }
#cssmenu_moo_menu ul ul li li
{ border-right:0 solid #000; }
#cssmenu_moo_menu a
{ color:#eee;
border-left:1px solid #444; }
#cssmenu_moo_menu a:hover
{ color:#303030; }
#cssmenu_moo_menu li.active a
{ color:#303030; }
#cssmenu_moo_menu li li a
{ color:#fff; }
#cssmenu_moo_menu li li a:hover
{ color:#303030; }
#cssmenu_moo_menu li li a:active
{ color:#eee; }
#cssmenu_moo_menu ul ul li a
{ padding:0 10px; }
#cssmenu_moo_menu ul ul li.active
{ ; }
#cssmenu_moo_menu li.active
{ background:url(../images/moomenu1.png) repeat-x top #303030; }
#cssmenu_moo_menu li a:hover,#cssmenu_moo_menu li a:active
{ color:#303030; }
#cssmenu_moo_menup
{ height:20px;
border:solid 1px #333;
background:#555; }
#cssmenu_moo_menup ul
{ margin:0;
padding:0;
list-style:none; }
#cssmenu_moo_menup li
{ float:left;
margin:0;
margin-top:0;
padding-left:0;
list-style:none; }
#cssmenu_moo_menup li a
{ display:block;
text-decoration:none;
color:#eee;
padding:0 10px 0 10px;
font-size:11px;
line-height:20px; }
#cssmenu_moo_menup li a:hover
{ color:#303030; }
#cssmenu_moo_menup li.active a
{ color:#303030; }
#cssmenu_moo_menup ul ul,#cssmenu_moo_menup ul ul ul
{ display:none; }
You might try using display: table-cell instead of list-style: none on the top level lis, and then set display: table; width: 100% on the top level ul. This forces the the lis to be displayed using the table layout algorithm, which allows you to define how much space you want the whole thing to take up (in this case 100%).
I would use a table for that. It's one of the situations that I find a table is most appropriate also means that you don't have to worry about it later should your require adding more links in the future.
I'm not sure that's possible. I think you will need to set the width of each menu element specifically to ensure it spans the full width of its container, and make the appropriate adjustments to your CSS file once you add new elements.
Danny answer work well here are the main element:
#menu_conteneur ul{
display:table;
width: 100%;
}
#menu li{
display: table-cell;
}
#menu li a{
display: block;
}