Closed (fixed)
Project:
Zen
Version:
5.x-1.x-dev
Component:
layout.css
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
30 Apr 2007 at 20:57 UTC
Updated:
1 Jan 2011 at 20:19 UTC
Can anyone explain how to edit the style.css so we can center the primary links menu (like how apple.com does)?
Comments
Comment #1
Timotheos commentedI'm using the Zen theme at http://www.heritagecollege.ca/ where the primary links are centered. You can take apart the style sheet from there. I basically took the styling clues from http://www.exploding-boy.com/2006/11/02/updated-centered-sliding-doors-m...
The tricky thing is in the template.php file because you have to add an extra span around the primary links plus you have to do some hacking for IE6/7.
I did this for the links.
For the IE6/7 hack I referred to the zen-fixed theme and added this at the end of my zen_variables function.
Hope that works for you :)
Comment #2
ipwa commentedThat's very handy, thanks for sharing that Timotheos,
I have one question though, how could I change the primary links in this theme to be aligned to the right side instead of the left or the center. Any thougths would be much appreciated.
Comment #3
osxpert commentedHi Timotheos,
that's a very nice tipp and exactly what I was looking for - unfortunately it doesn't work for me.
I've put the code into template.php, the span ist outputted too on the final page, but i'm missing something with the stylesheet. Where exactly is the "trick" to have the menus centered finally?
I'm using the Zen-Fixed-Theme, 5.x-1.x-dev (http://drupal.org/project/zen)
Comment #4
Shawn Parr commentedipwa,
I have the primary links on the right, do this in your overrides.css:
You may have to do some tweaking to #primary a, #primary li, and/or #primary ul if you want anything fancier to happen.
Comment #5
johnalbinComment #6
(not verified) commentedComment #7
johnvsc commentedWe have found that this solution works:
The key here is resetting the #primary ul to position: static (thanks to Roger Lopez for finding that out... not setting this, in IE6, causes the block to render out of place...) and setting the #primary li to display:inline instead of float:whatever.
hope this helps
Comment #8
Unity commentedThank you!
This is a beautiful solution and it worked perfectly!
Comment #10
nikita commentedThank you johnvsc!
Works like a charm :)