5 Replies Latest reply on May 12, 2010 3:22 AM by katinka2010

    alt text and doctype XHTML

    katinka2010

      Just a question to know if my thoughts are right...

       

      I have made my website and at the top DW has put:

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">

       

      I have notices that the alt-text in my site are not working (the way I would like), they are not displayed when you go over the image with the cursor. I know that the alt text will show up if the image fails to load for any reason but I would like them to show up also when you go over the image.

      After a long search I found that if I change DOCTYPE to HTML 4.01, the alt-text are displayed in the browsers (IE). But unfortunately I can't change the DOCTYPE because of my SPRY-menu.

       

      Is this correct?

      And is it also correct that the only way to show the text of an image (with doctype XHTML), is to make a title-tag of the image (which DW doesn't facilitate)?

       

      Katinka.

        • 1. Re: alt text and doctype XHTML
          hans-g. Adobe Community Professional & MVP

          Hi Katinka,

           

          where did you look for "go over"? In DW ore in your uploaded file in the Internet?

           

          Only to understand: did you control your DW source code?

          Is your alt entry something like that (here I used "Close" only as an example):

          <h1><img src="closelabel.gif" alt="Close" width="66" height="22"></h1>

           

          In my knowledge, doctype doesn't need to be changed, even though you use (as I do too) spry menus.

           

          Hans-G.

           

          P.S.

          In addition to John: I use IE 8 (modern enough?)

          • 2. Re: alt text and doctype XHTML
            John Waller Adobe Community Professional & MVP
            function(){return A.apply(null,[this].concat($A(arguments)))}

               I know that the alt text will show up if the image fails to load for any reason but I would like them to show up also when you go over the image.


            That's not the role of alt text. It's only for alternative text in the absence of an image-not a popup tooltip.

             

            It has worked as a tooltip in earlier versions of IE because they incorrectly displayed the alt attribute in the absence of the title attribute. It won't work in modern browsers and it's unrelated to the Doctype.

             

            Use the title attribute instead.

             

            <img alt="Picture" title="Picture">

            • 3. Re: alt text and doctype XHTML
              katinka2010 Level 1

              Thanks!

              I looked in DW (live view) and with 'Preview in IExplore'.

              And yes, my alt text looks like:

              <img src="images/closelabel.jpg" alt="Close" width="300" height="300" class="floatright" />

               

              After readying the anwser of John Walker, I understand that I have to use the title-tag.

              But isn't it a pity that DW doesn't provide a easy way to enter title-tag to a image?

              Katinka.

              • 4. Re: alt text and doctype XHTML
                katinka2010 Level 1

                Thank you!

                I understand that I have to use the title attribute.

                But isn't it a pity that DW doesn't provide a easy way to enter a title-attribute to a image?

                Regards, Katinka.

                • 5. Re: alt text and doctype XHTML
                  John Waller Adobe Community Professional & MVP
                  function(){return A.apply(null,[this].concat($A(arguments)))}

                  But isn't it a pity that DW doesn't provide a easy way to enter title-tag to a image?


                  Agreed. It has to be entered in Code View since there's no title attribute field in the Property Inspector.