SOLVED: Problem with navigation menu

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
handcoded
Forum Members
Forum Members
Posts: 123
Joined: Thu Dec 06, 2007 2:26 pm

SOLVED: Problem with navigation menu

Post by handcoded »

Hi

I'm using a free template called handyman and am having a headache with the navigation menu as it renders completely differently in different browsers.

IE - looks fine. Wording evenly spaced and padded
FF - No top or bottom padding
Chrome - Padding good but text aligned to top

I've simplified the template a little but here is what the header should look like
http://blog.templatemonster.com/2011/10 ... intenance/

Some help with this would be gratefully received.

Website uses CMS MS - Isabella.
Attachments
screengrab.png
Last edited by handcoded on Wed Nov 07, 2012 12:02 am, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Problem with navigation menu

Post by Dr.CSS »

As always a link to the problem site is best...
handcoded
Forum Members
Forum Members
Posts: 123
Joined: Thu Dec 06, 2007 2:26 pm

Re: Problem with navigation menu

Post by handcoded »

Problem website is www.handcoded.co.uk/spencer
gocreative
Power Poster
Power Poster
Posts: 265
Joined: Mon Mar 14, 2011 1:16 am

Re: Problem with navigation menu

Post by gocreative »

Have you tried specifying a height and line-height for the whole menu bar? If they're both set to the same value, this will vertically-align your text. Get rid of any top or bottom padding/margins on the text as well.
handcoded
Forum Members
Forum Members
Posts: 123
Joined: Thu Dec 06, 2007 2:26 pm

Re: Problem with navigation menu

Post by handcoded »

So it turns out that I had some un-ordered list code in my template which was conflicting with the menu and my problem is now resolved.

The last link on the navigation bar should have a class on it called last that curves the right edge.

I've looked at my menu template but cannot work out how I can define a class for the last menu link. Any ideas?

Thanks
gocreative
Power Poster
Power Poster
Posts: 265
Joined: Mon Mar 14, 2011 1:16 am

Re: Problem with navigation menu

Post by gocreative »

There are several ways:

Option 1
If you want to manually specify which the last link is, you can do the following:

1. Add this code to the LI (or A) in your menu template:

Code: Select all

class="nav-{$page_alias}"
This will output something like <li class="nav-projects">.

2. Create a new CSS class in your stylesheet called "li.nav-projects" and style as required.

Option 2
Automatically apply a "last" class using Smarty. Example here: http://www.i-do-this.com/blog/10/Add-cl ... -menu-item

Option 3
Use CSS and/or jQuery to automatically apply a style to the last child element.

CSS:

Code: Select all

li:last-child { /* your styles */ }
jQuery:

Code: Select all

$("nav ul.menu li:last-child").addClass("last");
handcoded
Forum Members
Forum Members
Posts: 123
Joined: Thu Dec 06, 2007 2:26 pm

Re: Problem with navigation menu

Post by handcoded »

Very thorough.

Thanks very much
Post Reply

Return to “Layout and Design (CSS & HTML)”