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;
}
Related
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.
I am trying to make my menu links #666666 and then on hover make it #FFFFFF
i want these colours to change on the text colour and the top border
http://jsfiddle.net/4Xdkn/
#topbar {
width:100%;
height:80px;
background-color:#000000;
}
#topbar-inner {
width:1000px;
margin:0 auto 0 auto;
}
#logo {
display:inline;
float:left;
margin-top:20px;
}
#menu {
display:inline;
float:right;
}
#menu > ul > li {
display:inline-block;
border-top:4px solid #666666;
margin-right:20px;
padding-top:20px;
min-width:120px;
}
#menu > li {
display:inline-block;
list-style:none;
margin-top:25px;
margin-left:auto;
margin-right:auto;
}
#menu > li:hover {
color:#FFFFFF;
}
Selectors should be
#menu li a {
color: #666;
display: block;
}
#menu li:hover {
border-top-color: #FFF;
}
#menu li:hover a {
color:#FFFFFF;
}
#menu has no direct li descendants so #menu > li:hover does not match anything.
http://jsfiddle.net/4Xdkn/8/
You have an error in your CSS
#menu > li does not target anything, since #menu is applied to a div and it has no direct children of type li.
Use these rules
#menu li {
display:inline-block;
border-top:4px solid #666666;
margin-right:20px;
padding-top:20px;
min-width:120px;
}
#menu li:hover,
#menu li:hover a {
color:#FFFFFF;
}
#menu li a {
color:#666666;
}
#menu li:hover {
border-color:#FFFFFF;
}
Demo at http://jsfiddle.net/gaby/4Xdkn/4/
Updated Fiddle
You need to add:
#menu li a {
display:block;
padding-top:25px;
border-top:4px solid #666666;
}
#menu
li a:hover {
border-color:red;
color:#fff
}
On #menu > ul > li remove the border-top and padding, because this has been added to the a tag now.
On #menu > li remove the margin-top property
try this
http://jsfiddle.net/4Xdkn/7/
#topbar {
width:100%;
height:80px;
background-color:#000000;
}
#topbar-inner {
width:1000px;
margin:0 auto 0 auto;
}
#logo {
display:inline;
float:left;
margin-top:20px;
}
#menu {
display:inline;
float:right;
}
#menu > ul > li {
display:inline-block;
border-top:4px solid #666666;
margin-right:20px;
padding-top:20px;
color:#ffffff;
min-width:120px;
}
#menu > li > a {
display:inline-block;
list-style:none;
margin-top:25px;
margin-left:auto;
margin-right:auto;
text-decoration:none;
color:#ffffff;
text-decoration:none;
}
#menu li:hover {
color:#FFFFFF !important;
text-decoration:none;
border-top:4px solid #ffffff;
display:inline-block;
}
#menu li a:hover{
color:#ffffff;
text-decoration:none;
}
}
Colorize the a-element instead of the li and make the a element as big as the li.
#menu li a:hover {
color:white;
border-style:solid;
border-width: 1px 0px 0px 0px;
border-color:white;
}
Try the below css
#topbar {
width:100%;
height:80px;
background-color:#000000;
}
#topbar-inner {
width:1000px;
margin:0 auto 0 auto;
}
#logo {
display:inline;
float:left;
margin-top:20px;
}
#menu {
display:inline;
float:right;
}
#menu > ul > li {
display:inline-block;
margin-right:20px;
min-width:120px;
}
#menu > li {
list-style:none;
padding:25px 0 0 0;
margin-left:auto;
margin-right:auto;
border-top:1px solid #fff;
}
#menu ul li a:hover {
color:#FFFFFF;
}
#menu li a {display:block; padding:20px 0 0 0;border-top:4px solid #666666;}
#menu li a:hover { border-top:4px solid #fff; color:#fff}
Hi guys this is my CSS code for a drop down menu:
#nav {
-moz-background-clip:border;
-moz-background-inline-policy:continuous;
-moz-background-origin:padding;
background-color:#60625C;
bottom:0;
left:0;
margin:0;
padding:0;
width:100%;
position:absolute;
z-index:1;
}
#nav, #nav ul {
line-height:40px;
list-style-image:none;
list-style-position:outside;
list-style-type:none;
width:100%;
}
#nav a, #nav a:hover {
-moz-background-clip:border;
-moz-background-inline-policy:continuous;
-moz-background-origin:padding;
border:medium none;
display:block;
text-decoration:none;
}
#nav li {
float:left;
list-style-image:none;
list-style-position:outside;
list-style-type:none;
border-right:1px solid #6E7073;
}
#nav a, #nav a:visited {
color:#FFFFFF;
display:block;
padding:0 20px;
}
#nav a:hover, #nav a:active, .current_page_item a, #home .on {
text-decoration:none;
}
#nav li ul {
border-bottom:1px solid #6E7073;
height:auto;
left:-999em;
line-height:30px;
margin:0;
padding:0;
position:absolute;
width:222px;
}
#nav li li {
-moz-background-clip:border;
-moz-background-inline-policy:continuous;
-moz-background-origin:padding;
background:#1E1F21 none repeat scroll 0 0;
border-left:1px solid #6E7073;
border-right:1px solid #6E7073;
border-top:1px solid #6E7073;
width:220px;
}
#nav li li a, #nav li li a:visited {
-moz-background-clip:border;
-moz-background-inline-policy:continuous;
-moz-background-origin:padding;
background:#1E1F21 none repeat scroll 0 0;
color:#FFFFFF;
font-size:0.9em;
font-weight:normal;
}
#nav li li a:hover, #nav li li a:active {
-moz-background-clip:border;
-moz-background-inline-policy:continuous;
-moz-background-origin:padding;
background:#60625C none repeat scroll 0 0;
}
#nav li:hover ul, #nav li li:hover ul, #nav li li li:hover ul, #nav li.sfhover ul, #nav li li.sfhover ul, #nav li li li.sfhover ul {
left:auto;
}
However the menu is being placed in an unwanted position at the bottom of the screen.
How can I make it display between the title and main content of the blog?
This is the code relating to the navigation in 'header.php'
<div id="navbar">
<div id="nav">
<ul>
<li>Home</li>
<?php wp_list_pages('title_li=&depth=0&sort_column=menu_order&exclude=56'); ?>
</ul>
</div>
Many thanks in advance.
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.
trying to fix a CSS bug for some code that someone else wrote. I'm no CSS expert, so I'm having trouble trying to find what is giving me this problem. This page is supposed to have 4 main menu buttons at the top. The user can hover over each and it will display a sub menu. This work fine in FF and IE, but in Safari and Chrome the buttons end up in the same spot, causing them all to display sub menus when you hover over the first button.
Link to HTML: http://www.blogtrog.com/code.aspx?id=c4c62a1a-af8f-4bfc-a3c3-f1fbf9013b3d
Here's the chunk of CSS that controls the main menu:
.top-bar {
background: url('/img/top-gradient.jpg') repeat-x top;
height : 50px;
}
.top-bar-content {
width : 1000px;
margin-left: auto;
margin-right: auto;
}
.menu-bar {
background : url('/img/menu-gradient.jpg') repeat-x top;
height : 25px;
vertical-align : middle;
}
.menu-bar-content {
height : 25px;
width : 1000px;
color : #ffffff;
font-weight : bold;
margin-left: auto;
margin-right: auto;
}
.footer-bar {
width : 1000px;
text-align : right;
margin-left: auto;
margin-right: auto;
}
hr {
border : none 0;
border-top : 1px dashed #333333;
width : 100%;
height : 1px;
}
/* menu */
ul#menu
{ margin:0; padding:1px 0; list-style:none; width:1000px; height:21px; font:normal 12px arial, verdana, helvetica; font-weight: bold;}
ul#menu li
{ margin:0; padding:0; display:block; float:left; position:relative; width:160px; }
ul#menu li a:link,
ul#menu li a:visited
{ padding:4px 0; display:block; text-align:left; text-decoration:none; color:#ffffff; width:160px; height:13px; }
ul#menu li:hover a,
ul#menu li a:hover,
ul#menu li a:active
{ padding:4px 0; display:block; text-align:left; text-decoration:none; color:#ffffff; width:158px; height:13px; }
/* sub menu */
ul#menu li ul.sub-menu
{ margin:0; padding:1px 1px 0; list-style:none; display:none; background:#ffffff; width:158px; position:absolute; top:21px; left:-1px; border:1px solid #990000; border-top:none; }
ul#menu li:hover ul.sub-menu
{ display:block; }
ul#menu li ul.sub-menu li
{ width:158px; clear:left; width:158px; }
ul#menu li ul.sub-menu li a:link,
ul#menu li ul.sub-menu li a:visited
{ clear:left; background:#d6d6d6; padding:4px 0; width:158px; border:none; border-bottom:1px solid #ffffff; position:relative; z-index:1000; color:#333333;}
ul#menu li ul.sub-menu li:hover a,
ul#menu li ul.sub-menu li a:active,
ul#menu li ul.sub-menu li a:hover
{ clear:left; background:#d6d6d6; padding:4px 0; width:158px; border:none; border-bottom:1px solid #ffffff; position:relative; z-index:1000; }
/* sub sub menu */
ul#menu li ul.sub-menu li ul.sub-sub-menu
{ display:none; margin:0; padding:0; list-style:none; position:absolute; left:157px; top:-2px; padding:1px 1px 1px 1px; border:1px solid #b9121b; border-left:1px solid #b9121b; background:#ffffff; z-index:900; }
ul#menu li ul.sub-menu li:hover ul.sub-sub-menu
{ display:block; }
ul#menu li ul.sub-menu li ul.sub-sub-menu li a:link,
ul#menu li ul.sub-menu li ul.sub-sub-menu li a:visited
{ background:#d6d6d6; }
ul#menu li ul.sub-menu li ul.sub-sub-menu li:hover a,
ul#menu li ul.sub-menu li ul.sub-sub-menu li a:hover,
ul#menu li ul.sub-menu li ul.sub-sub-menu li a:active
{ background:#d6d6d6; }
/* span style */
ul#menu li ul.sub-menu li a span
{ position:absolute; top:0; left:144px; font-size:12pt; color:#990000; }
ul#menu li ul.sub-menu li:hover a span,
ul#menu li ul.sub-menu li a:hover span
{ position:absolute; top:0; left:144px; font-size:12pt; color:#ffffff; }
Under ul#menu add
position: absolute;