Closed (fixed)
Project:
Zen
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
3 Jan 2008 at 20:46 UTC
Updated:
21 Jan 2008 at 16:21 UTC
I don't seem to be able to cleanly add a border to the items in the primary links menu.
I want to get the effect of a vertical bar that divides the menu items, using a border-right: CSS rule.
However, because of the height set on the navbar, the border looks too short.
Setting a height on the LI doesn't work because they're inline, rather than floats (as I think they were previously).
Is there anything you can suggest?
Comments
Comment #1
joachim commentedGot it sussed :)
Set the LI to float:left, and the A to display:block so they fill up the space and :hover and .active looks right.
Also, I think I was getting tripped up by the presence of the navigation anchor point.
You might want to add a note to the comments of the docs warning to be careful of styling #navbar a -- use #navbar #primary a to be sure not to catch the anchor point by mistake.
Comment #2
johnalbinJoachim, which browser are you using?
I’ve had other reports of CSS styles for
abeing applied to<a name="top"></a>and<a name="navigation" id="navigation"></a>, but I haven’t experienced it, so I want to get the comment correct when I document it.I was thinking of adding:
But I’d like to test it.
Comment #3
joachim commentedI'm using Firefox 2.
What really threw me is that if I set a float on the A, I get the first link on one line, followed by the remaining links on the next, and that happens even when I make sure not to catch the anchor:
I've figured it out.
The first floated A gets taken out of the row of inline LIs and put to the left of them. The next As all have to go beneath the LIs. The reason is that the LIs have PADDING -- set in various places. This means they take up space even though with the As floated out they are completely empty elements. If you set a background-color on the LIs you can see it.
Kill the padding and it's fine -- it's new to this version of Zen and Drupal's system.css seems to be adding it too, which as far as I can tell it didn't before.
And actually -- now I try it out, setting a display:block that catches the anchor is ok. The following works fine on Firefox and IE6:
For reference, then, this is what I have for block-type links with highlighting:
Feel free to include that in docs if you like :)
Comment #4
johnalbinI changed the default inline method for navbar links to:
Comment #5
catchJust a quick note that
display: inlineon list items has inconsistent behaviour between FF and IE - I haven't yet run up against this with navigation, but when I made the "who's online" block into a comma separated list via css, IE fails on both :after and wrapping. I'd imagine with a large number of primary links it'd do the same thing.I dealt with this for myself by overriding theme_item_list to insert newlines after each
</li>(now a handbook page, although I'm not sure it really deserves one): http://drupal.org/node/199861Doesn't help with the specific bug here, but since I saw this issue I thought it'd be worth mentioning.
Comment #6
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.