I am working on creating a horizontal menu that is both vertically and horizontally aligned.
Currently, I am using
- tags, and it appears as desired in Firefox. However, the rendering is correct only in this browser.
- In Internet Explorer 9, the background shifts 1px higher when hovering over an item.
- In Chrome, the height of the li element is 20px instead of 16px like in Firefox, causing the menu to move slightly lower.
- In Safari and Opera, I encounter the same issue as in Chrome.
Additionally, Opera, Safari, and Chrome have a problem where my separator is 3px high and 1px wide, while it displays correctly in Firefox.
After spending two nights trying to solve this problem, I realize I need some assistance.
Here is how the menu appears in Firefox (click on images to zoom in):
And here is the situation in Chrome (in WebKit browsers):
The CSS for the menu is as follows:
<!-- CSS code goes here -->
The HTML markup can be found here:
<!-- HTML code goes here -->
If modifying the HTML structure helps resolve the issue caused by ul tags, I am open to suggestions. What matters most is finding a cross-browser solution without resorting to specific styles for each browser version.
The backgrounds of my menu and the hover effect are gradients, so simply using a solid color is not an option.
Any suggestions would be greatly appreciated as I strive to find a solution without extensive browser-specific styling. Many thanks in advance.
Edit 1: I am struggling with setting the exact height for the separator. It seems that placing text inside does not achieve the desired sizing since it is within an inline element.
Edit 2: I have uploaded the complete webpage with graphics for reference. While I have not created a JSFiddle yet, you can view and download the webpage as a ZIP file:
Edit 3: I have added the JS Fiddle link, though I am experiencing difficulty getting the font to display properly.