Margin on a menu changing

I have a menu here: and I had a 90px top margin on it which was fine ( when logged out ) except when logged in the menu then displayed like this ( attached )

So I have removed the 90px top margin and that makes it fine when logged in but when logged out the menu is then touching the top of the screen like so:


It’s hard for use to debug when we don’t have access to both the logged in and logged out versions.

If the logged in version has different html then you will need to add a class or something to the page so you can modify the margins on the menu depending if logged in or not.

However your margin-top of 90px is what we call a magic-number anyway and you would be better off structuring the html so that things fall into place easily and without using excessive margins to push them below other elements. Margins usually maintain the space between elements rather than making them just fit.

How if I pm you the login details so that you can have a look? Would you be willing?

The problem is that the html is written in the template and I have looked at the html and it all seems to be the same, I’m not sure but how can I put a class on it for a single page if the menu is visable throughout all pages?

Thanks for your help

Try this.

#header.header1 #main-menu{margin-top:0;clear:right;}
1 Like


That’s it!!! And it even fixed the issue I was having with the login not aligning with the menu below it too. I don’t fully understand it still but it’s very clever.

Thank you

Yes. Paul is a smart guy. But I will not say it aloud just in case that he starts believing that he’s better than what he really is :stuck_out_tongue:


This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.