SitePoint Sponsor

User Tag List

Page 2 of 3 FirstFirst 123 LastLast
Results 26 to 50 of 70
  1. #26
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Stormrider View Post
    What about images that are for decoration only?
    That's what CSS is for.

  2. #27
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Yea, what are decorative presentational images doing in the structural mark-up

  3. #28
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So if you have a site with, say, 100,000 articles where each one has a decorative-ish picture associated with it, you recommend littering the CSS with 100,000 ID selectors and background-image rules?

    Keeping decorative images as CSS backgrounds may be feasible for a relatively static and small site, but as soon as you're using a CMS it becomes futile.
    Birnam wood is come to Dunsinane

  4. #29
    SitePoint Wizard silver trophybronze trophy Stormrider's Avatar
    Join Date
    Sep 2006
    Location
    Nottingham, UK
    Posts
    3,133
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Take this page:

    http://news.bbc.co.uk/1/hi/world/americas/8034284.stm

    There are 2 images there (one of the pigs, one of the queue of vans) which aren't part of the content, they are just decorative - an 'aside' to the article if you will. If the picture wasn't there, the content would still be complete.

    Are you arguing that those images should be css background images?

    It simple isn't as clear cut as 'all decorative images should be in the css, all content related images should be <img> tags', because there are images that fit into neither category.

  5. #30
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,869
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Stormrider View Post
    Personally, I think the majority of alt attributes should end up being empty. Depends on the type of site you have, but a LOT of images are only used for decoration, even if they are related to the content, it's often just a photo to spice up the look of a page.
    In a lot of those cases it is probably at least worth considering moving the image to the CSS rather than keeping it in the HTML
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  6. #31
    SitePoint Wizard silver trophybronze trophy
    Join Date
    Jul 2008
    Location
    New York, NY
    Posts
    1,432
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Stormrider you are absolutely correct....

    In a real world situation the only 'decorative' images that need to be set as background images are drop shadows, modules, etc....

    It would be silly and add unnecessary weight to the css file to make all 'decorative' images background images.... > Same thing Tommy said...

  7. #32
    SitePoint Wizard silver trophybronze trophy
    Join Date
    Jul 2008
    Location
    New York, NY
    Posts
    1,432
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This brings up the same situation with graphic headings being inline opposed to background images....

    Code:
    <h2><img src="about.gif" width="130" height="14" alt="About" /></h2>
    
    <h2 id="about">About</h2>
    h2#about { background: url("about.gif") no-repeat; text-indent: -999em; }
    Say there are 15,000 headings.... Same thing occurs - unnecessary css weight...

  8. #33
    SitePoint Addict joaquin_win's Avatar
    Join Date
    Jul 2005
    Location
    Venezuela
    Posts
    224
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AutisticCuckoo View Post
    I would recommend those of you who are unsure about how to use the alt attribute to read Must I have an ALT attribute for every image? in the HTML FAQ. Compare the four different scenarios where a particular image is used, and note how very different the text equivalent is in each case.
    After reading that resource you linked, I see that SitePoint's homepage the images for each post in the Latest Blogs section would be better off with empty alt attributes. Specially since they all say "Image for <title of post>" right after the actual title of the post.

    What do you think?

    Edit: the same goes for the Editor’s Choice section that has duplicate information which could confuse/piss off visitors using a screen reader

  9. #34
    SitePoint Wizard silver trophybronze trophy Stormrider's Avatar
    Join Date
    Sep 2006
    Location
    Nottingham, UK
    Posts
    3,133
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    In a lot of those cases it is probably at least worth considering moving the image to the CSS rather than keeping it in the HTML
    I see 2 types of 'decorative' images here. One that are, as cooper.semantics mentioned, shadows, list item bullets, graphics of the website basically. Layout images, rounded corners, all the graphics that make up the site.

    But also, you have images that are related to the content (although not part of it), which are also decorate - as in a lot of BBC News articles and many other similar sites, and I think these make up the majority of images on a lot of sites. These are decorative, but they aren't background images - and so should have an empty alt attribute.

    Where images are part of the content (eg a photograph illustrating a point made in the text, a chart or graph showing a trend etc), the alt text should be a text alternative - ie, roughly the same information could be got from reading the text as you would from looking at the image.

    Do you see the distinction? Do you really believe that the second type of 'decorative' image I described belongs in the CSS? ie, Those 2 photos from the BBC link I pasted should be empty <div> tags with background image in the css set?

  10. #35
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,869
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Stormrider View Post
    I see 2 types of 'decorative' images here. One that are, as cooper.semantics mentioned, shadows, list item bullets, graphics of the website basically. Layout images, rounded corners, all the graphics that make up the site.

    But also, you have images that are related to the content (although not part of it), which are also decorate - as in a lot of BBC News articles and many other similar sites, and I think these make up the majority of images on a lot of sites. These are decorative, but they aren't background images - and so should have an empty alt attribute.

    Where images are part of the content (eg a photograph illustrating a point made in the text, a chart or graph showing a trend etc), the alt text should be a text alternative - ie, roughly the same information could be got from reading the text as you would from looking at the image.

    Do you see the distinction? Do you really believe that the second type of 'decorative' image I described belongs in the CSS? ie, Those 2 photos from the BBC link I pasted should be empty <div> tags with background image in the css set?
    I see the distinction but there are a lot of people who get the two confused which is why I suggested that, where an image doesn't need alt text for people who don't see it to be able to understand the content without it, that the author really needs to work out which of those two categories of 'decorative' that the image is really in so as to make sure that those that really do belong in the CSS are put there. Too many people include those background images in the wrong place rather than making the distinction and moving those that are truly decorative and unrelated to the content into the CSS where they belong.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  11. #36
    Floridiot joebert's Avatar
    Join Date
    Mar 2004
    Location
    Kenneth City, FL
    Posts
    823
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My interpretation is that if the spec says the attribute must be present, then it must also not be empty.

    It would be pointless to require the attribute if it can just be empty. That's like saying a fish needs a fish bowl to survive, but it doesn't need to have any water in it.

  12. #37
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Stormrider View Post
    There are 2 images there (one of the pigs, one of the queue of vans) which aren't part of the content, they are just decorative - an 'aside' to the article if you will. If the picture wasn't there, the content would still be complete.
    I would argue that neither of those images (in the content) are decorative (well at least not in the sense we are talking about), they are intended to give representation to help portray an image. I only qualify decorative images as those which are simply provided to decorate the website as a design in opposition to acting as content visual aids and those kind of images which are specific to the site in opposition to enhancing the content should in my opinion be kept separate as they are highly unlikely to differentiate between every page, unless some serious convention breaking is going on (in terms of pages trying to maintain a core level of similarity between how the site is represented site wide).

  13. #38
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by joebert View Post
    My interpretation is that if the spec says the attribute must be present, then it must also not be empty.
    That interpretation is incorrect.

    Quote Originally Posted by joebert View Post
    It would be pointless to require the attribute if it can just be empty.
    Not in this case. The attribute is required because not all users (or user agents) can perceive images, so there needs to be a text equivalent. An image that doesn't convey any relevant information (the image itself may still be relevant, but only as an image) in a particular context doesn't have a text equivalent. Or, rather, the text equivalent is 'nothing'.

    Therefore, specifying alt="" for such an image is every bit as important as a non-empty text equivalent is for an image that does convey information. It's an explicit statement that says, 'this image does not convey any vital information'. By using an explicit, albeit empty, text equivalent the author signals that he/she knows what he/she is doing.

    An omitted attribute, on the other hand, raises questions: is it deliberately omitted to imply there is no text equivalent, or is it an accidental oversight, or is the author completely clueless about markup, semantics and web standards?

    Explicit is usually much better than implied.

    Quote Originally Posted by joebert View Post
    That's like saying a fish needs a fish bowl to survive, but it doesn't need to have any water in it.
    No, it's not. Is like saying that a fish bowl doesn't need to have any fish in it to be a fish bowl. Yes, normally you'd have fish in it, but there's no law against having an empty fish bowl around.
    Birnam wood is come to Dunsinane

  14. #39
    SitePoint Wizard silver trophybronze trophy Stormrider's Avatar
    Join Date
    Sep 2006
    Location
    Nottingham, UK
    Posts
    3,133
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by joebert View Post
    My interpretation is that if the spec says the attribute must be present, then it must also not be empty.

    It would be pointless to require the attribute if it can just be empty. That's like saying a fish needs a fish bowl to survive, but it doesn't need to have any water in it.
    No, it isn't at all. Putting the attribute there and leaving it empty is useful information - it tells a reader that there is no text alternative for this image. Leaving the attribute out all together leaves it as an 'unknown'.

    You have read one thing in the spec, and made up another rule out of that. It says the attribute is required, and then the following text:

    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 ("")
    So by assuming something from the spec, you have actually contradicted it. The spec says to use an empty alt attribute when appropriate.

    Edit: What Tommy said!

  15. #40
    SitePoint Wizard silver trophybronze trophy Stormrider's Avatar
    Join Date
    Sep 2006
    Location
    Nottingham, UK
    Posts
    3,133
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AlexDawson View Post
    I would argue that neither of those images (in the content) are decorative (well at least not in the sense we are talking about), they are intended to give representation to help portray an image. I only qualify decorative images as those which are simply provided to decorate the website as a design in opposition to acting as content visual aids and those kind of images which are specific to the site in opposition to enhancing the content should in my opinion be kept separate as they are highly unlikely to differentiate between every page, unless some serious convention breaking is going on (in terms of pages trying to maintain a core level of similarity between how the site is represented site wide).
    OK, so you think those images should have alt text then? What should that alt text be?

  16. #41
    SitePoint Enthusiast
    Join Date
    Jun 2007
    Posts
    71
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Alt tags also help in SEO. That is one more reason to have them.

  17. #42
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,892
    Mentioned
    123 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by joebert View Post
    My interpretation is that if the spec says the attribute must be present, then it must also not be empty.

    It would be pointless to require the attribute if it can just be empty. That's like saying a fish needs a fish bowl to survive, but it doesn't need to have any water in it.
    Sorry, but that interpretation doesn't work. The specs do most definitely allow an empty attribute where that is appropriate.

    If an image has no alt attribute at all, user agents that can't display the image won't know whether that's because the author doesn't want the people to be told of the image or is just ignorant and has missed off the alt attribute - so they play safe, and announce the image. They may do this by simply saying "image", or they may announce the filename, or both.

    By specifying an empty alt attribute, the author is explicitly saying "there is an image here but it is not essential to the page, so user agents that can't display the image should ignore it". That is a valid and useful option to have, and conveys more information than simply omitting the alt attribute altogether.

  18. #43
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by csspisces View Post
    Alt tags also help in SEO. That is one more reason to have them.
    There is no such thing as an <alt> tag in HTML or XHTML.

    And I doubt that alt attributes make much difference to SEO since they have been spammed to bits by clueless SEO 'experts' for years. The only case where they may count is for image searches.

    Anyway, what do you suggest one should use as a text equivalent – for 'SEO' purposes – for an image that doesn't convey any relevant information in the context where it's used?
    Birnam wood is come to Dunsinane

  19. #44
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,892
    Mentioned
    123 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by csspisces View Post
    Alt tags also help in SEO. That is one more reason to have them.
    1. There is no such thing as an alt tag.
    2. If the images support the text then the relevant words will feature in the text content, so little if any value will be added by repeating them in the alt attribute.

    The SEO benefits of alt text are minimal, and should not be seen as a reason to go against good practice.

  20. #45
    SitePoint Member
    Join Date
    May 2009
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it is important for seo

  21. #46
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ammuseo View Post
    it is important for seo
    Do you have any proof of that?

    And I repeat the question I asked of csspisces who claimed the same thing:

    What do you suggest one should use as a text equivalent – for 'SEO' purposes – for an image that doesn't convey any relevant information in the context where it's used?

    If you don't post a believable reply to this I'm forced to conclude that your post was nothing more than an attempt to gain visibility for your signature links, which is a violation of the forum guidelines.
    Birnam wood is come to Dunsinane

  22. #47
    SitePoint Member
    Join Date
    May 2009
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you put alt in your images. google will be easily crawl in image search. if you have try it in your site.

  23. #48
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Right. I said as much in post #44.

    Now, the question is: would the average site owner want his/her images to be easily found by search engines? If you're a photographer or graphics artist, then yes, of course. But if you have a stock photo image as an eye-catching accompaniment to your article?

    And please give some concrete examples on a suitable text equivalent for a mainly decorative image, which would be beneficial for SEO without being detrimental to accessibility.
    Birnam wood is come to Dunsinane

  24. #49
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Stormrider View Post
    OK, so you think those images should have alt text then? What should that alt text be?
    Well I might be tempted to put the following...

    Image 1 (The pigs)

    Two pigs representing meat under localised export bans.
    Image 2 (The vans)

    Van's couriering mexicans in china to a homebound charter plane

  25. #50
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Alex, those text fragments would probably confuse the heck out of me if they appeared in the middle of an article text, e.g., on my mobile or in Lynx.
    Birnam wood is come to Dunsinane


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •