Results 1 to 3 of 3

Thread: Validation problem with DD gallery

  1. #1
    Join Date
    Feb 2006
    Posts
    39
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Validation problem with DD gallery

    1) Script Title: CSS Images

    2) Script URL (on DD): http://www.dynamicdrive.com/style/cs...image-gallery/
    Item 4.1

    3) Describe problem:

    I am puzzled, as when validating a page of images using this gallery I get this:

    Line 51, Column 218: required attribute "alt" not specified.

    .src="images/hist/lovells-ct-05.jpg" /><br />Visit to Lovells Court 2005</span

    The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.

    Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.

    Here is line 51
    <a class="thumbnail" href="#thumb"><img
    src="images/hist/thumb/tn_lovells-ct-05.jpg" width="200px" height="140px"
    border="0" alt="photo of Visit to Lovells Court 2005" /><span><img src="images/hist/lovells-ct-05.jpg" /><br />Visit to Lovells Court 2005</span></a>

    Being this is a Dynamic drive css gallery, I went back to source and looked at source code. There is no Alt at all and in fact had double the amount of errors when I validated it than I have. ;-))

    Can someone please throw some light on how I can correct this code please?

    Many thanks

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Basically, all image tags must have alt attributes for strict validation. If you have an image tag without an alternate and it wouldn't be appropriate for design purposes to give it one, or you just don't want to, you can give it an empty alt attribute.

    In other words, in this particular case, you can just add (red):

    Code:
    <img src="images/hist/lovells-ct-05.jpg" alt="" />
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Feb 2006
    Posts
    39
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    Many thanks John, that works and now validates. Just a case of knowing where the 'alt' needed to go.

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
  •