Afficher un message
Vieux 29/02/2008, 06h48   #1
GTalbot
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Opera problem with auto centered menu

On 24 fév, 09:48, totalstranger <totalstran...@not.yahoo.net> wrote:

> Can someone please take a look at this and give some suggestions.http://www.arnb.org/testmenu.html


Hello,

I checked your stylesheet and I saw a few problems:

/* Set up the first level list items */
#nav li {
position:relative; /* this allows positioning of second level */
display: inline; /* show as a horizontal line */
}

but that's not the correct CSS rule for the first level items. The
correct rule is:

#nav > li {
position:relative; /* this allows positioning of second level */
display: inline; /* show as a horizontal line */
}

and when correcting such CSS rule, that makes this other CSS hack
[
background:transparent url(IMAGES/transparent.gif);/*forces IE7 to
work without scripting*/
/* otherwise secondary menu blanks out on a hover*/
]

... completely useless, pointless: so, you can remove that
background: transparent url(...);
declaration entirely.

Some other points:

#nav, #nav ul { /* all lists */
padding: 0;
margin: 0;
list-style: none;
font-weight:normal;
text-align: center;
}


can be better replaced by

ul
{
padding: 0;
margin: 0;
list-style: none;
text-align: center; /* although we explained centering is not best */
}


Also

The selector
#nav li ul li a, #nav li ul li a:visited { ... }
can be better replaced by
#nav ul a, #nav ul a:visited { ... }

You may think those changes are cosmetic but they in fact parse
the CSS code faster and with lesser chances of triggering bugs in
browsers.

I then checked in Opera 9.26 and my demo works .. although Opera 9.26
is a bit iffy. It works better in Opera 9.50 build 9807 though.

Regards, Gérard
  Réponse avec citation
 
Page generated in 0,05625 seconds with 9 queries