/    Sign up×
Community /Pin to ProfileBookmark

Need some help with a menu

Hi All

I have designed a menu using css, see here: [url]http://www.johnbrewerphotography.com/[/url] and while it looks good in FireFox, in Internet Explorer when the mouse hovers over the text, the text in the menu moves left.

Here is the basic code I am using:

[code=html]<div id=”menu”>
<div id=”title”><img alt=”Logo” src=”images/logo.gif” /></div>

<div id=”links”>
<a href=”http://www.johnbrewerphotography.com/index.html”>Home</a>
<a href=”http://www.johnbrewerphotography.com/portfolio/”>Portfolio</a>
<a href=”http://www.johnbrewerphotography.com/purchasing.html”>Purchasing</a>
<a href=”http://www.johnbrewerphotography.com/technical_notes.html”>Technical Notes</a>
<a href=”http://www.johnbrewerphotography.com/about.html”>About</a>
<a href=”http://www.johnbrewerphotography.com/contact.html”>Contact</a>
<a href=”http://www.johnbrewerphotography.com/links.html”>Links</a>
</div>
</div>

#links {
margin: 10px;
}

#menu
{
height: 490px;
font-size: 13pt;
}

#menu img {
margin-right: 10px;
}

#menu #links a
{
display: block;
margin-top: 5px;
padding: 2px;
padding-left: 6px;
border: 1px solid #FFF;
border-left: 4px;
color: black;
text-decoration: none;
}

#menu #links a:hover
{
padding-left: 2px;
color: rgb(50%,0%,0%);
color: black;
border-bottom: 1px solid #666;
border-left: 4px solid #666;
}
[/code]

Any help would be much appriciated.

Joe

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@FangMar 25.2006 — #links a
{
display: block;
margin-top: 5px;
padding: 2px;
padding-left: 6px;
border: 1px solid #FFF;
border-left: 4px solid #fff;
/* font: bold; */
color: black;
text-decoration: none;
}

#links a:hover
{
padding: 2px;
padding-left: 6px;
margin-top: 5px;
/* background-color: #D4D4DF; */
color: rgb(50%,0%,0%);
color: black; /* color redefined ? */
border: 1px solid #FFF;
border-bottom: 1px solid #666;
border-left: 4px solid #666;
}

Don't need [I]#menu #links[/I], [I]#links[/I] already points to one element.
Copy linkTweet thisAlerts:
@CFHuttonMar 25.2006 — You've got your "a" with a padding-left: 6x and your "hover" with a padding-left: 2px. Seems to me that would shift something left on hover.

Why does it work fine in ff and not in IE? I think because of the box model problem in IE. If you switched your doctype to strict instead of transitional, I think it would display the same in both browsers, but I'm not positive. I THINK transitional doctypes tell IE to display in "quirks" mode which I'm pretty sure you'd like to avoid "quirks" mode unless you REALLY know what you're doing.

If it were me, I'd try changing the padding to match in the hover and "a" states first, but I wouldn't be surprised if it didn't fix things.

This is all what I THINK, and if past history is any indicator, it's all completely wrong!

CFH
×

Success!

Help @Brewster spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...