July 17th, 2013, 03:29 AM
Superfish sub menu centered
I have centered the Superfish Navbar menu on the page but struggling to find a way to center the first level sub menu on the page.
I'm unable to post a link here as this is my first post here.
July 18th, 2013, 02:04 AM
Welcome to DevShed Forums, msathesh.
What are you trying to center the sub-menu in the relation to all of the first-level items or its parent item?
As you found out new users are restricted from posting URLs until they have made 5 posts. You may need to get around this by leaving out the "http://" and putting a space before each ".". Yes this rule is annoying, but the administrators say it's necessary for limiting spam.
July 18th, 2013, 02:35 AM
I'm trying to center the sub menu. Please see the screenshot here:
imagebin . org/264897
Last edited by Kravvitz; July 18th, 2013 at 07:26 PM.
Reason: removed unnecessary quote
July 18th, 2013, 08:51 AM
Superfish Menu Center
You need to create the separate class for the sub menu that will be the good way.
Originally Posted by msathesh
July 18th, 2013, 07:00 PM
Thanks. Here is the fiddle, jsfiddle.net/msathesh/uPzQW/1
I'm trying to get the sub menu centered in relation to it's parent. Right now, the sub menu starts from where the main menu starts which is already centered with a specified width & margin:0 auto; property.
How should I proceed with separating the class?
Originally Posted by ashishkg17
Last edited by Kravvitz; July 18th, 2013 at 07:25 PM.
Reason: fixed the URL
July 18th, 2013, 07:25 PM
Remove the "position" declaration from the ".sf-navbar li" rule and change the values for "top" and "left" in the ".sf-menu ul" rule as needed.
Just ignore ashishkg17. What he said made no sense.
July 18th, 2013, 08:17 PM
Thanks a lot Kravvitz,
I could use the left and top property for the sub-menu but that means I have to have equal number of sub menu items under each one so that it looks centered to it's parent. Okay think about this case, if I have 3 sub-menu items under a menu-item and only 1 sub-menu item in another, it would look weird.
I wish I could center the sub-menu with margin:0 auto; property but I couldn't. It will look centered no matter how many number of menu items in the sub menu.
Originally Posted by Kravvitz