Hi Everyone,

I'm trying to get a menu at the top of my page (I've already created the region) to display horizontally. From reading here I figured out how to use the

display: inline;

to make it display horizontally but I was applying that to the ul.menu.li and that of course makes all my menu's display horizontally.

I guess the question is how can I make my new menu unique so that when I target it to make it display inline I only am affecting that menu?

Thanks again for reading.

Comments

ridolfidesigns’s picture

Not sure if this is the best way to do it but this is how I usually do it.

When I create the region for my menu I usually do it like this:

<?php if ($someregion): ?>
     <div id="somedivid"><?php print $someregion; ?></div>
<?php endif; ?>

What that does is whenever you put something in that region, it will create a div around it with whatever ID name you specify. Then you can put in your CSS something like:

#somedivid ul.menu {
code goes here
}

And it will effect only the ul.menu within that div.

I hope that was helpful.

Thanks,

Eric

Eric
Ridolfi Designs
http://ridolfidesigns.com
http://myspace.com/manofvalor25

timnorman’s picture

I did it by stepping through CSS. Usually there is a path that will make it unique. If you created a region then the region should be included in your path. Here is what I did so my list of menu items in my header was specifically targeted.

div #header .content .menu li.leaf

I'm not sure right now if I really neded the .content or .menu but it helps when I look back at it.

I'm basing my theme on Zen theme. This is partially because it places id and class tags all over the place in the html which allows me to easily target certain parts of the page.

To me it looks like you need some other classes or id's before the ul.menu.li so you only target 1 area.

ridolfidesigns’s picture

To me it looks like you need some other classes or id's before the ul.menu.li so you only target 1 area.

That's what the code does that I provided.

Eric
Ridolfi Designs
http://ridolfidesigns.com
http://myspace.com/manofvalor25

sunset_bill’s picture

Aren't you using Primary Links for your top menu (or are you already using that for something else)? I'd start there since it's already a unique region that can be styled separately from other menus. Otherwise, you will need to add a new region in your template and page.tpl.php so you'll have a unique element id to work with.

salud,
Bill

jburnard’s picture

Hey Guys,

Many thanks for the replies. Yes I've already used the Primary Menu somewhere else and I've created a new region, but not sure that I did it like described above so I will recheck. I'll see what I can do. Thanks again.