17 Replies Latest reply: Jul 25, 2009 1:47 AM by rlinsurf1 RSS

    Errors

    rlinsurf1 Community Member

      I'm getting the following error on my page:

       

      Line 41, Column 42: Attribute "ALIGN" is not a valid attribute. Did you mean "align"?

       

      Here's Line 41:

       

       

      <tr valign="top"><td></td><td><div align="center"><img name="picture" src="http://charlesnewmanpubl.com/images/covers/cd2top.jpg" alt="" border="0"><br> 
      
      
      

       

       

      I don't particularly see what's wrong with this.

       

      Here's my page:

       

       

      http://charlesnewmanpubl.com/catalog.html
        • 1. Re: Errors
          Nadia-P CommunityMVP

          That's because you are using a strict doctype and all styling (that includes border, align etc) needs to be in the stylesheet.

           

          So need to use something like this:

          <table style="margin:0 auto; background:#700104; border:0; width:760;" >
          

           

          If you don't wan't to go through and change all the code to bring it into 'Strict' mode, you can always change the doctype to transitional by going to:

          File>Convert>HTML 4.01 Transitional and the doctype will be changed automatically and you should not see those errors again when you validate.  You'd have to do with this with all the pages.

           

           

          I'm also seeing a blue link box around your top navigation buttons (using FFox), if you add the following to your styles in the head of the document, it will remove them.

           

          a img {border: none}
          

           

          Just an observation:  not sure who the target market is for the site, but I'm finding it very very difficult to read the text in the CD list (below the main image).

           

           

           

          Nadia

          Adobe® Community Expert : Dreamweaver

           

          Unique CSS Templates |Tutorials |SEO Articles

          http://www.DreamweaverResources.com

          http://csstemplates.com.au/

          --------------------------------------------------

          http://twitter.com/nadiap

          • 2. Re: Errors
            rlinsurf1 Community Member

            Hi, Nadia--

             

            Thank you so much. Those are really good tips.

             

            I changed all the table tags, and added the border thing for firefox. However, I'm still getting the same error:

             

            Line 42, Column 42: Attribute "ALIGN" is not a valid attribute. Did you mean "align"?

             

            …align="top"><td></td><td><div align="center"><img name="picture" src="http://

             

            So I'm confused.

             

            Also, it looks like there's still a blue border around the bottom image in Firefox.

             

            Yes, I know about the text for the albums. That's going to be my last part of the job. I can't seem to get it out of Illustrator to Photoshop without pixelating.

            • 3. Re: Errors
              Nadia-P CommunityMVP

              Again, the same problem, align is a style, so has to go in to the stylesheet or inline-like the following examples:

              /* uses align to center */
              
              <div style="text-align:center"></div>
              
              /* uses margin to center */
              <div style="width:400px; margin: 0 auto"></div>
              

               

              So in other words, anything that styles an element, like border, align, font etc., has to go into a style rule.  There really is no benefit of having a strict type over a transitional one - apart from very clean coding  :-)  so to save yourself the trouble of having to change the coding, just change the doctype as I mentioned in my first post.  Once you get the idea of how things work  andd the differences between the two doctypes, then you can make a switch to Strict.

              • 4. Re: Errors
                rlinsurf1 Community Member

                Ok. I think I get it. Once I removed the div tag where the error was, after putting in the new formatting, the error disappeared.

                 

                So now I'm down to 4 errors.

                 

                Line 44, Column 15: Attribute "STYLE" is not a valid attribute. Did you mean "style"?

                 

                 

                <iframe style="border: 0pt none ; float:left;margin-left:215px;display: none; wi
                

                 

                 

                And here's the full line

                 

                <iframe style="border: 0pt none ; float:left;margin-left:215px;display: none; width: 400px; height: 27px;" id="mp3Holder" src="http://www.google.com/reader/ui/3247397568-audio-player.swf?audioUrl=http://charlesnewmanpubl.com/audio/mp3s/cd1/Sweethearts_On_Parade_LA1.mp3&amp;autoPlay=true"></iframe>
                

                 

                 

                I'm also still getting the blue border around the bottom as well.

                • 5. Re: Errors
                  Kath-H Community Member

                  With the strict doctype you must use all lower case.

                  • 6. Re: Errors
                    rlinsurf1 Community Member

                    Hi, Kath--

                     

                    But it is lowercase. That's why I'm confused.

                    • 7. Re: Errors
                      Kath-H Community Member

                      Line 44, Column 15: Attribute "STYLE" is not a valid attribute. Did you mean "style"?

                      This appears to be telling you that you are using upper case instead of lower. Sorry if I'm not getting it.

                      • 8. Re: Errors
                        Nadia-P CommunityMVP

                        No, the code is all lower case, it's the fact that a strict doctype is being used and that's the way the errors get outputted - have no idea why - and yes, it is totally confusing.

                         

                        With a strict doctype all sytax has to be absolutely correct - otherwise you will get validation errors as you have already proven by fixing your errors.

                         

                        As for the iframe, I don't use that at all so never had to validate it, so not sure what the problem is, but have a look at this page -right at the bottom referencing inframes.

                        http://www.w3.org/TR/REC-html40/present/frames.html

                         

                        You can get a way with using a transition doctype if you really want to use the iframe - you won't get the errors.

                         

                        Now  have a read of this article to see why it's not a good idea to be using an iframe:

                        http://www.practicalecommerce.com/blogs/post/116-Using-iFrames-in-xHTML-1-0-Strict

                        • 9. Re: Errors
                          rlinsurf1 Community Member

                          Hi, Nadia--

                           

                          I actually am using the strict doc type because Nancy here asked me to. She said she needed it to be error free in Strict, to be able to diagnose what may be happening in Safari.

                           

                          As far as the iframe, I would love to get rid of it, since I get nothing but all these errors because of it. I just don't know how (surprise).

                          • 10. Re: Errors
                            Kath-H Community Member

                            Validating the css shows a floated element with no width declared, and a couple of other errors:

                             

                            http://jigsaw.w3.org/css-validator/validator?profile=css2&warning=2&uri=http%3A%2F%2Fcharl esnewmanpubl.com%2Fcatalog.html

                            • 11. Re: Errors
                              Kath-H Community Member

                              A clue here maybe in the html validation check? Maybe it will be necessary to change the doctype:

                               

                              This error is often caused by incorrect use of the "Strict" document type with a document that uses frames

                              • 12. Re: Errors
                                Kath-H Community Member

                                Maybe frames includes iframes? I don't use them either so I'm not sure.

                                • 13. Re: Errors
                                  rlinsurf1 Community Member

                                  Hi, Kath--

                                   

                                  When I started, I had no errors for css. I had about 40 for html. So now, I'm down to 4 for html, but all this stuff for css.

                                   

                                  Also, the article on why iframes are bad says:

                                   

                                  "Simply place this code in your HTML document where you would normally place your iFrame:

                                   

                                  And that is it."

                                   

                                  So the code is no longer in the blog article.

                                  • 14. Re: Errors
                                    rlinsurf1 Community Member

                                    I just checked the css validator. Those errors are just the 3 corrections I made by pasting in Nadia's code.

                                    • 15. Re: Errors
                                      Nadia-P CommunityMVP

                                      I didn't use any widths in my code  :-)

                                       

                                      This is the problem:

                                       

                                      <table style="margin:0 auto; background:#700104; border:0; width:760;" >
                                      

                                      it needs to be 760px   and you have 3 instances of that.  whenever you define a width you need to add a measuring using - generally pixels  :-)

                                       

                                       

                                      as for the iframe, can't help there - sorry,. maybe try a few more google searches as I did.

                                       

                                      iframe +stric doctype

                                       

                                      and see if that shows up anything besides the article I pointed to.

                                      • 16. Re: Errors
                                        rlinsurf1 Community Member

                                        I did what you said and added px to the 760's and it looks like those css errors are gone, so again, my thanks.

                                         

                                        I still have 3 errors -- excluding the iframe thing, which I'm certainly too dumb to fix, and I've looked everywhere for a solution (admittedly that I understand) until I can get the page error-free, so I hope you wont mind me posting them here.

                                         

                                        Thanks again.

                                        J.

                                        • 17. Re: Errors
                                          rlinsurf1 Community Member

                                          Well, spoke too soon. I think I basically understood doing it using object thus:

                                           

                                           

                                          <object style="border: 0pt none ; float:left;margin-left:215px;display: none; width: 400px; height: 27px;" id="mp3Holder" data="http://www.google.com/reader/ui/3247397568-audio-player.swf?audioUrl=http://charlesnewmanpubl.com/audio/mp3s/cd1/Sweethearts_On_Parade_LA1.mp3&amp;autoPlay=true"></object>
                                          
                                           
                                          

                                           

                                           

                                          However, now the JS doesn't work, as far as the player goes. It changes the image ok, and will play the very first track, but no matter what other link you click, it will only play the first track, and wont stop playing the first track if another is clicked. So this is no longer working for the player anyway.

                                           

                                           

                                          function doButtons(picimage, mp3file, dlURL) {
                                               var playerSrc = 'http://www.google.com/reader/ui/3247397568-audio-player.swf?audioUrl=';
                                               var autoPlaySrc = '&autoPlay=true';
                                                    document['picture'].src=picimage;
                                                    document.getElementById('mp3Holder').style.display = "inline-block";
                                                    document.getElementById('mp3Holder').src = playerSrc + mp3file + autoPlaySrc;
                                                    document.getElementById('ac3dl').href = dlURL;
                                                    document.getElementById('ac3dl').style.display = "inline-block";
                                                    window.scrollTo(0,0);
                                               }