PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.info.authoring.CSS > Re: Opera problem with auto centered menu
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Re: Opera problem with auto centered menu

Réponse
 
LinkBack Outils de la discussion
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
Vieux 11/03/2008, 04h37   #2
totalstranger
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Opera problem with auto centered menu

On or about 2/29/2008 1:48 AM, it came to pass that GTalbot wrote:
> 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

Gérard
Just want to thank you for providing your excellent suggestions and
taking the time to look at this code. Also thanks to everyone else who
responded, even when the suggestions were not easy for me to accept. I
have much more to learn about CSS.


  Réponse avec citation
Vieux 11/03/2008, 05h43   #3
totalstranger
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Opera problem with auto centered menu

On or about 3/10/2008 11:37 PM, it came to pass that totalstranger wrote:
> On or about 2/29/2008 1:48 AM, it came to pass that GTalbot wrote:
>> 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

> Gérard
> Just want to thank you for providing your excellent suggestions and
> taking the time to look at this code. Also thanks to everyone else who
> responded, even when the suggestions were not easy for me to accept. I
> have much more to learn about CSS.
>
>

Unfortunately about 43% of folks looking at my site are using IE6 which
does not eat most CSS selectors including child selectors (>). Kind of
suspect many of them are Windows 2000 in corporate offices. Since I
already adjust for IE and the rest of the browser universe, it's a
simple matter to another css file for IE6.

Arn
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 21h26.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,12479 seconds with 11 queries