centering my nav menu
-
Hey, I’ve been at this for hours. Just trying to get this stupid menu centered. I’ve tried everything I can think of, but nothing works. If any one could give me a hand with this it would be much appreciated.
here’s the link to my blog: https://www.chriszachary.com/blog
As you can see the menu items are aligned to the left. And I want them centered, and closer together. Here are the codes im working with
PHP:
<div>
<ul id=”menu”>-
<?php wp_list_categories(‘show_count=&title_li=0’); ?>
-
<?php wp_get_archives(‘type=monthly’); ?>
<?php wp_list_pages(‘sort_column=menu_order&title_li=’); ?>
CSS:
#menu {
list-style: none;
margin: 0;
padding: 0 0 0px 15px;
height: 10%;
}
#menu:after {
content:” “;
display:block;
clear:both;
}
#menu li {
padding:8px 30px 0px 30px;
float:left;
}
#menu li a {
height:25px;
float:left;
text-align:center;
text-decoration:none;
}
#menu li.hover a,
#menu li:hover a,
#menu li.hover,
#menu li:hover {
position: relative;
}
#menu li.hover ul,
#menu li:hover ul {
display: block;
}
#menu ul {
padding:14px 0 6px;
margin:0;
list-style:none;
width:147px;
display: none;
position: absolute;
left: 0;
top: 100%;
background:#e9e6dd;
}
#menu ul li {
padding:0 10px 0 17px;
width:120px;
}
#menu ul li a {
text-align:left;
width:100%;
background:none;
color:#7a7a7a;
line-height:18px;
height:auto;
display:block;
}
- The topic ‘centering my nav menu’ is closed to new replies.