Try adding the CSS to your theme’s stylesheet.
Tried that. I added the code below in the theme’s stylesheet & got this message “Parse error: syntax error, unexpected “
#navmenu ul {margin: 0; padding: 0;
list-style-type: none; list-style-image: none; }
#navmenu li {display: inline; }
#navmenu ul li a {text-decoration:none; margin: 4px;
padding: 5px 20px 5px 20px; color: blue;
background: pink;}
#navmenu ul li a:hover {color: purple;
background: yellow; }
Stylesheets don’t produce parse error messages. Not even when they’re really mangled. Sounds like you tried to add this to a template (.php) file instead of a stylesheet (.css) file.
Thanks esmi you’re an absolute star, you can’t imagine how much stress this has caused me.
Here’s my edited code which I added to the stylesheet.
navmenu ul {margin: 0; padding: 0;
list-style-type: none; list-style-image: none; }
#navmenu li {display: inline; }
#navmenu ul li a {text-decoration:none; margin: 4px;
padding: 4px 4px 4px 4px; color: white;
background: 00085c;}
#navmenu ul li a:hover {color: white;
background: blue; }
But I can’t seem to put the menu in the centre of the page. What do I have to edit or add to the code to do that?
Thanks
I can see the menu on the site right now but, in theory, you’d need to give the menu container a fixed width and margin:0 auto;.
I edited the code with the “auto;” but still no luck.
#navmenu ul {margin: 0; auto; padding: 0;
list-style-type: none; list-style-image: none; }
#navmenu li {display: inline; }
#navmenu ul li a {text-decoration:none; margin: 4px;
padding: 4px 4px 4px 4px; color: white;
background: 00085c;}
#navmenu ul li a:hover {color: white;
background: blue; }
No – try:
#navmenu {
width:700px;
margin:0 auto;
}
Adjust the width to suit.
Wonderful, you did it again esmi π
This is the code I ended up with:
#navmenu ul {
width:700px;
margin:0 auto;
list-style-type: none; list-style-image: none; }
#navmenu li {display: inline; }
#navmenu ul li a {text-decoration:none; margin: 4px;
padding: 4px 4px 4px 4px; color: white;
background: 00085c;}
#navmenu ul li a:hover {color: white;
background: blue; }
<p>Archives:<?php wp_get_archives(‘format=custom&show_post_count=1&type=yearly&after=;’); ?>
Categories:<?php echo str_replace(”,’;’, wp_list_categories(‘style=&show_count=1&echo=0’));?></p>
It wasn’t working in Firefox so I put back the Archives code & it worked a treat.
I can’t sleep easy now, seriously it was really stressing me out. Thank you esmi. π
Glad to hear that you got it sorted in the end. π