Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

EvanLugh

macrumors 68000
Original poster
Aug 29, 2007
1,929
3
Developer land
Hi. I'm having a bit of trouble with the navigation on Wordpress. I'd like it to be set horizontally instead of vertically.
You can see it here:
4a18a71eb40d2622321262cd68e92d67.png

I've changed the text-wrap, positions, alignment.. everything. It's in a list (albeit was horizontally before I edited it.) The code is as follows.

HTML:
PHP:
<div id="navbar">
	<ul>
			<li><?php wp_list_pages('title_li=&depth=1'); ?></li>
	</ul>
</div>
And the CSS
#navbar ul {
list-style-type: none;
margin-left: -30px;
margin-bottom: 0px;
margin-right: 0px;
margin-top: -8px;
text-decoration: none;
padding: 0px;
}

#navbar ul li a {
border-spacing: 3px 3px;
margin-left: 730px;
margin-bottom: 0px;
margin-right: 50px;
margin-top: 80px;
font-family: Arial, Verdana, Sans-Serif;
font-size: 20px;
text-decoration: none;
display: inline;

}
Many thanks for your help.

Ps - I know everything is further down - it's the menu's margins.
 
Looks like you have all the links in a single li tag. Each item should be in its own li.
 
Thanks for the reply, angelwatt. I've already attempted several different links and li tags but the same happens. What's being shown in the example is being brought together by Wordpress.
 
Depending on the outputted HTML from that PHP you'll want to add the following,
Code:
#navbar ul li {
 display: inline;
}
Can you supply the actual HTML that gets outputted?
 

In the PHP get ride of the li tags around the PHP that puts in the links, as they each already have li tags around them. You're currently outputting HTML that has an li in side an li without a ul or ol, which is incorrect HTML. So remove the li tags in the PHP then use that snippet of CSS I posted. That should make it inline.
 
It might have something to do with the margin-left: 730px. Also, border-spacing only applies to table elements.
 
Sometimes the ul li a wants to have a float: left; to get it inline, test it.
change margin to margin: 80px 50px 0px 730px; so save some code instead of margin-left, margin-top and so on
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.