www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Client-Side Development > HTML

    HTML Discussion and technical support for building, using and deploying HTML sites.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1  
    Old 11-08-2005, 01:33 PM
    JAPerson JAPerson is offline
    Registered User
     
    Join Date: Oct 2005
    Posts: 36
    Question required attribute "ALT" not specified

    Ugh! Why is this attribute so darn important in my IMG tags? I just started validating my website which I have never done before and I get all these errors due to missing ALT attribute. So I slap in alt="" and it is happy. I really didn't define the function of the image, I just stuck the tag in there with an empty definition to get validated. It just makes me question why validating is so important. Nothing I ever change makes the site look different or work different. The only reason I am changing things is just to get some sort of "approval" thing.
    Reply With Quote
      #2  
    Old 11-08-2005, 01:38 PM
    JPnyc's Avatar
    JPnyc JPnyc is offline
    Administrator
     
    Join Date: May 2004
    Location: Manhattan NY
    Posts: 5,818
    Because sometimes images don't load, and also so your page makes some sense to text browsers
    __________________
    Webdeveloper.com Online Community Manager

    Reply With Quote
      #3  
    Old 11-08-2005, 03:16 PM
    NogDog's Avatar
    NogDog NogDog is offline
    High Energy Magic Dept.
     
    Join Date: Aug 2004
    Location: Ankh-Morpork
    Posts: 13,640
    Quote:
    Originally Posted by JPnyc
    Because sometimes images don't load, and also so your page makes some sense to text browsers
    ...including text-to-speach, braille, and other such browsers for the physically impaired.

    Of course, you can cheat and just do a global search-and-replace on "<img" with "<img alt=''", but that doesn't help any users who visit your site in a non-graphical browser.
    __________________
    "That's what the gods are! An answer that will do! Because there's food to be caught and babies to be born and life to be lived and so there is not time for big, complicated, and worrying answers! Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be." -- from Nation, by Terry Pratchett
    freelancer.internet.com
    Email me
    Reply With Quote
      #4  
    Old 11-09-2005, 01:19 AM
    JAPerson JAPerson is offline
    Registered User
     
    Join Date: Oct 2005
    Posts: 36
    OK, so I do want a site that is user friendly for all. But I am still puzzled as to what I should put in these alt attributes that would aid such browser users.
    Reply With Quote
      #5  
    Old 11-09-2005, 01:29 AM
    Kevey's Avatar
    Kevey Kevey is offline
    Know_Nothing
     
    Join Date: Sep 2005
    Posts: 604
    A simple description of the image would do. If you had a picture of a dog, you could put alt="dog". You can be more descriptive if you wish and put "brown dog jumping over a fence". Whatever you think would convey your message to a person that can't see your images for whatever reason.
    Reply With Quote
      #6  
    Old 11-09-2005, 01:33 AM
    NogDog's Avatar
    NogDog NogDog is offline
    High Energy Magic Dept.
     
    Join Date: Aug 2004
    Location: Ankh-Morpork
    Posts: 13,640
    For each image, just consider what information it conveys to the user, if any. If it is purely decorative, it's probably OK to just have an empty alt="" attribute. If, for example, it is used as a link, then the alt text should describe (breifly) what it links to. From http://www.w3.org/TR/html4/struct/objects.html#adef-alt :
    Quote:
    While alternate text may be very helpful, it must be handled with care. Authors should observe the following guidelines:
    • Do not specify irrelevant alternate text when including images intended to format a page, for instance, alt="red ball" would be inappropriate for an image that adds a red ball for decorating a heading or paragraph. In such cases, the alternate text should be the empty string (""). Authors are in any case advised to avoid using images to format pages; style sheets should be used instead.
    • Do not specify meaningless alternate text (e.g., "dummy text"). Not only will this frustrate users, it will slow down user agents that must convert text to speech or braille output.
    __________________
    "That's what the gods are! An answer that will do! Because there's food to be caught and babies to be born and life to be lived and so there is not time for big, complicated, and worrying answers! Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be." -- from Nation, by Terry Pratchett
    freelancer.internet.com
    Email me
    Reply With Quote
      #7  
    Old 11-09-2005, 02:03 AM
    JAPerson JAPerson is offline
    Registered User
     
    Join Date: Oct 2005
    Posts: 36
    Great advice everyone! Thanks!
    Reply With Quote
      #8  
    Old 12-17-2008, 08:08 PM
    etard etard is offline
    Registered User
     
    Join Date: Sep 2003
    Posts: 233
    reviving an old topic...

    I am conflicted with including ALT tags where not needed. For example, lets say you use a spacer transparent gif or an image that has no value other than artistic - versus say a button image you would clearly want to ALT tag, when validating it wants you to add an ALT tag to these types of images that have no value having said tag.. I don't want to or need it as it provides nothing for that type of image. In doing so, it seems to be that having several iterations of an empty ALT ="" creates dirty & bloated code versus no ALT at all, so I would rather not have it.. but cannot 100% validate without it.
    Reply With Quote
      #9  
    Old 12-17-2008, 08:22 PM
    felgall's Avatar
    felgall felgall is offline
    Computer Consultant
     
    Join Date: Mar 2005
    Location: Sydney, Australia
    Posts: 7,979
    Quote:
    Originally Posted by etard View Post
    reviving an old topic...

    I am conflicted with including ALT tags where not needed. For example, lets say you use a spacer transparent gif or an image that has no value other than artistic - versus say a button image you would clearly want to ALT tag, when validating it wants you to add an ALT tag to these types of images that have no value having said tag.. I don't want to or need it as it provides nothing for that type of image. In doing so, it seems to be that having several iterations of an empty ALT ="" creates dirty & bloated code versus no ALT at all, so I would rather not have it.. but cannot 100% validate without it.
    No such thing as a spacer image any more since you can control spacing more accurately using CSS.

    Any image that doesn't need an alt description should also be added to the page as a background from the CSS rather than being in the HTML. The HTML should only contain the real content of the page (including alternative text descriptions of all the images that describes the purpose that they serve in being in the page).

    Spacer images and other "artistic" images create dirty bloated HTML when you use them and should be completely deleted from there and the correct CSS used in their place.

    Last edited by felgall; 12-17-2008 at 08:24 PM.
    Reply With Quote
      #10  
    Old 12-17-2008, 08:30 PM
    etard etard is offline
    Registered User
     
    Join Date: Sep 2003
    Posts: 233
    yes, i was just making the point.. forget about the spacer..

    lets say I use an image as a border edge along the bottom of a page. it is a nice artistic touch that caps off the bottom edge and is only a mere 1 pixel tall. no value to adding an ALT tag to it..

    and, relative to bloated coated.. it seems it takes more actual code KB to write the css style then it does to just include this image in the actual pages code as there, all you are doing is calling an image while in a css you are writing the style, placing the style in the page code, calling the style, parsing the style, and still displaying the image.. that seems more 'bloated' code than just placing the image in the page.
    Reply With Quote
      #11  
    Old 12-18-2008, 05:53 AM
    Charles's Avatar
    Charles Charles is offline
    JavaScript Banned
     
    Join Date: Nov 2002
    Location: Baltimore, Maryland
    Posts: 11,667
    Please read the section from the spec that was quoted by Mr. NogDog.
    __________________
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web
    Reply With Quote
      #12  
    Old 12-18-2008, 06:31 AM
    Kor's Avatar
    Kor Kor is offline
    Red Devil Moderator
     
    Join Date: Dec 2003
    Location: Bucharest, ROMANIA
    Posts: 11,142
    Quote:
    Originally Posted by etard View Post
    it seems it takes more actual code KB to write the css style then it does to just include this image in the actual pages code as there[...]
    You are right. But only with a single word: it seems. Well, it fact it is not like that. Images in CSS background are loading faster. One of the reasons is that CSS is loaded first, as the code is placed in the HEAD section. Definitely CSS way has only advantages.
    Reply With Quote
      #13  
    Old 12-18-2008, 06:34 AM
    Kor's Avatar
    Kor Kor is offline
    Red Devil Moderator
     
    Join Date: Dec 2003
    Location: Bucharest, ROMANIA
    Posts: 11,142
    On the other hand... Why do you feel so angry that you need to use ALT for images? Is it so hard to keep the accessibility of your page?
    Reply With Quote
      #14  
    Old 12-18-2008, 10:36 AM
    etard etard is offline
    Registered User
     
    Join Date: Sep 2003
    Posts: 233
    certainly not 'angry' about anything.

    I look at it in terms of pieces of code.. which adds up to KB.. so, if the ALT tag is not conveying any info, why include it? it is an empty tag so why even include the 5 extra characters of ALT""? that, to me, is bloated.

    and, no "accessibility" is lost or gained by ALT tagging images that have no value. Like I said, and like NogDog quoted the obvious, on links or buttons or images that contain info of value ALT tags make sense... but on some images on the page they have no value so why even include an empty tag?
    Reply With Quote
      #15  
    Old 12-18-2008, 04:06 PM
    felgall's Avatar
    felgall felgall is offline
    Computer Consultant
     
    Join Date: Mar 2005
    Location: Sydney, Australia
    Posts: 7,979
    If the alt attribute is empty then the image should either be part of the background or not there at all. The HTML should only contain the content of the page and not anything that relates purely to its appearance - CSS is where you define the way the page looks.

    Any image entered in the HTML that is genuinely part of the content and belongs there will never have a blank alternative text since the alternative text is the equivalent text cotent to what the image means when it shows in the page.
    Reply With Quote
    Reply

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is Off
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 10:32 PM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.