7 Replies Latest reply on Mar 27, 2010 4:49 PM by jonboy0000

    "-moz-user-select" and "-khtml-user-select" in spryaccordion.css won't validate

    jonboy0000 Level 1

      Hi guys,

       

      I recently validated all of my htmls, and my next endeavor is doing the same with my CSS stylesheets.

       

      On my spry accordion css's, I have under .accordionPanelTab "-moz-user-select: none;" and "-khtml-user-select: none;". I did a google search and it says they will affect netscape, and I assumed firefox, but I removed them completely and checked out the site - and I don't notice any difference.

       

      Are these needed? Is there a way I can re-code them to validate?

       

      thanks all,

      jon

        • 1. Re: "-moz-user-select" and "-khtml-user-select" in spryaccordion.css won't validate
          Nancy OShea Adobe Community Professional & MVP

          These are browser specific rules.  Don't worry about them.  If you remove them, Linux and Firefox user's will have problems selecting accordion panels.

           

          Nancy O.

          Alt-Web Design & Publishing

          Web | Graphics | Print | Media  Specialists

          http://alt-web.com/

          http://twitter.com/altweb

          http://alt-web.blogspot.com

          1 person found this helpful
          • 2. Re: "-moz-user-select" and "-khtml-user-select" in spryaccordion.css won't validate
            jonboy0000 Level 1

            I guess I can just ignore them, but isn't it always a good thing to validate? And if not, why have validation to begin with?

             

            Again, I'm new to web-design, but I don't understand why there's even a set of rules to comply with if everyone says I should ignore them anyway. Being an architect, I can't just choose to obey/defy building codes as I please, just because we need a "quick fix." If there really is no way around these hacks, then why have a set of standards that refuses to allow them?

            • 3. Re: "-moz-user-select" and "-khtml-user-select" in spryaccordion.css won't validate
              Nancy OShea Adobe Community Professional & MVP

              You have to learn the rules before you can break them. 

               

              It is always better to work with valid code.  But as you gain experience in web design, you'll soon learn that valid code isn't always enough for non-web standards compliant browsers.   Thus, on occasion we must resort to browser specific rules, hacks or HTML markup (such as Flash or Google embed code)  that doesn't pass W3C validation tests.  Knowing when and where to draw the line with valid/invalid code is part skill and part art, I'm afraid.   Nobody said this was going to be easy.

               

               

              Nancy O.
              Alt-Web Design & Publishing
              Web | Graphics | Print | Media  Specialists
              http://alt-web.com/
              http://twitter.com/altweb
              http://alt-web.blogspot.com

              1 person found this helpful
              • 4. Re: "-moz-user-select" and "-khtml-user-select" in spryaccordion.css won't validate
                jonboy0000 Level 1

                Of course not easy, but at least possible? Again, I just don't understand why there's even a set of standards if they need to be broken in some instances.

                 

                As for my specific case, I read that the -moz-user-select and -khtml-user-select only determines whether or not the title can be selected as part of the text (see text below). Is it really necessary to restrict/allow a user from doing this if it means breaking validation? I guess I'm asking you for your opinion as to where I should draw the line this time... 

                 

                 

                "Indeed this behavior is not w3c standard but you may drop it if you want. In this situation the Accordion will behave exactly as it does on IE and when you select the text in the page you will be able also to select the title for the panel. " - Christian Marin

                 

                As always Nancy,

                thanks for the advice

                • 5. Re: "-moz-user-select" and "-khtml-user-select" in spryaccordion.css won't validate
                  jonboy0000 Level 1

                  As an alternative to fixing these individual errors, would you suggest using an IE-specific style-sheet, or I guess Mozilla/khtml-specific, with conditional comments?

                   

                  I refuse to believe that hacks are completely necessary if they won't validate. There needs to be some way around this, otherwise the creators of w3 standards would have to be aware that they are essentially meaningless and would be ignored... right?

                  • 6. Re: "-moz-user-select" and "-khtml-user-select" in spryaccordion.css won't validate
                    Nancy OShea Adobe Community Professional & MVP

                    As an alternative to fixing these individual errors, would you suggest using an IE-specific style-sheet, or I guess Mozilla/khtml-specific, with conditional comments?

                     

                    Conditional Comments were a Microsoft invention to get around the fact that IE was/is not web standards compliant. You can't use CCs for any other browsers.

                     

                    I refuse to believe that hacks are completely necessary if they won't validate.

                     

                    Suit yourself.  If all you want is a very basic site that sort of works in most modern browsers but not too well in older ones, feel free to skip the hacks.  That's your prerogative.

                     

                    There needs to be some way around this, otherwise the creators of w3 standards would have to be aware that they are essentially meaningless and would be ignored... right?

                     

                    Back in the day, before the W3C stepped in with mandates for Web Standards, chaos reigned.  Every new browser had it's own set of proprietary standards (IE, Netscape and AOL were the giants).  Web designers (myself included) were putting disclaimers on our sites "This site works best in [insert browser name and version here].  It was totally insane.  IMO the W3C has made things much better by clarifying standards and educating web designers and browser developers to see the light. All except MS IE, of course.  IE still moves to the beat of a different drum.

                     

                    Adapting browsers to accept changes takes much R&D, beta testing and updates.  Mozilla, Gecko and WebKit are taking the lead in this respect.  But full support for all the new CSS3 tags like Border-Radius and User-Select are still evolving. During this interum, we can either use browser-specific tags for those browsers that need them, or choose not to use the property at all.

                     

                    IE9 promises to support all the current CSS 2.1 and new CSS3 properties but it will be at least 1 year before it's ready as a release candidate.  Then, it likely will be another 4-5 years before we can stop supporting IE7 & 8.

                     

                    Add to this mix the forthcoming HTML 5 web standard.  It's not finalized yet, but when it is, the browsers will need to be redesigned to accept the new markup tags.  Some older browsers will never be able to accept the new tags.  So once again, we will need conditional comments, scripts and other hacks to help ensure a good user experience for everyone.

                     

                     

                    Nancy O.
                    Alt-Web Design & Publishing
                    Web | Graphics | Print | Media  Specialists
                    http://alt-web.com/
                    http://twitter.com/altweb
                    http://alt-web.blogspot.com

                    • 7. Re: "-moz-user-select" and "-khtml-user-select" in spryaccordion.css won't validate
                      jonboy0000 Level 1
                      During this interum, we can either use browser-specific tags for those browsers that need them, or choose not to use the property at all.

                      Well, I actually did remove a few properties, changed what I could, and fixed a couple errors - and I managed to validate the stylesheet without using the hacks. I've tested the site in IE 6, 7 and 8 and it works fine, from what I can tell on the surface...


                      I did have a problem with a property "b/ackground: #FFF;" - everytime I changed it at all the menubar would dissapear in IE, but when I completely removed it all was fine somehow. I've been testing it to see what changed, but I really can't find any problems.

                       

                       

                      Thanks for the advice on the standards and IE. You're probably right, I should have just let things be. I'm sure in due time I'll find out what those hacks were for exactly. But I've checked it in a few browsers and it seems okay.

                       

                      If I couldn't validate what I had, I considered reverting back to the original spry .css sheet dreamweaver provides, which does validate, and going from there. I'd honestly rather sacrifice the changes that were made to it and a few graphical properties like opacity, etc. than let them get in the way of validation - And I know people could argue with that statement but I somehow feel better knowing my site is 100% valid.

                       

                      That and it gave me a reason to blow off everything else at work... lol - Thanks again