SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    SitePoint Addict mserms's Avatar
    Join Date
    Jun 2001
    Location
    Scotland
    Posts
    230
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    objects instead of imgs in XHTML

    I'm writting in XHTML strict 1.0 and would like to use OBJECT tags rather than IMG tags to see what it'll be like in XHTML 2.0. I can't seem to find a decent desription of using the OBJECT tag, or perhaps I'm just dim.

    I'm using:

    Code:
    <object class="index-guide" data="guide.jpg" type="image/jpeg" width="100" height="66"></object>
    Why does the object have scrollbars around it (the image is 100x66)? Am I specifying it correctly? What can I use to display alternate text? Also can the object tag be closed using <object ... />?

    Thanks a lot,

  2. #2
    (****** or Deleted)
    Join Date
    May 2002
    Location
    Melbourne, Australia
    Posts
    299
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As far as I am aware, you cannot use the object tag to display an image in XHTML 1... I can find no reference at w3c that it is possible sorry...
    Jordan Windebank

  3. #3
    SitePoint Addict mserms's Avatar
    Join Date
    Jun 2001
    Location
    Scotland
    Posts
    230
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmmm. I assumed that as it's in HTML 4.01 and XHTML 2.0 it would also be in XHTML 1.0. Seems a bit daft doesn't it?

    It sort of works, could just do without the scrollbars:

    http://www.scottishclimbs.com/dev/index.htm

    EDIT: works fine in Opera 6, scrollbars in IE 5.5 (PC).
    Last edited by mserms; Sep 24, 2002 at 06:24.

  4. #4
    SitePoint Enthusiast plattopus's Avatar
    Join Date
    Aug 2002
    Location
    Melbourne, Australia
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Works fine for me (IE 6.0, Windows 98)

  5. #5
    SitePoint Addict mserms's Avatar
    Join Date
    Jun 2001
    Location
    Scotland
    Posts
    230
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh dear, I'm a goat! Can you try this one please?

    http://www.scottishclimbs.com/dev/index_obj.htm

    Cheers!

    EDIT: It's the one in the guides box.

  6. #6
    (****** or Deleted)
    Join Date
    May 2002
    Location
    Melbourne, Australia
    Posts
    299
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Looks good in Moz 1, wonder why the XHTML 1 spec did not mention it... will keep looking
    Jordan Windebank

  7. #7
    SitePoint Zealot
    Join Date
    Aug 2002
    Location
    Bristol, UK
    Posts
    122
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could try adding a scrolling="no" attribute to the object tag.
    Andy: Always Morphin Dwarfs

  8. #8
    SitePoint Addict mserms's Avatar
    Join Date
    Jun 2001
    Location
    Scotland
    Posts
    230
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've tried that one - no joy.

  9. #9
    Super Ninja Monkey Travis's Avatar
    Join Date
    Dec 2001
    Location
    Sioux City, Iowa
    Posts
    691
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It looks like an IE 5.5 problem. It works in IE 6 and Netscape 7 for me (Win98).
    Travis Watkins - Hyperactive Coder
    My Blog: Realist Anew
    Projects: Alacarte - Gnome Menu Editor

  10. #10
    SitePoint Enthusiast
    Join Date
    Jun 2002
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    on a mac

    looks right in ns4.7, ie5.1, ns6.2 and opera5.0...
    now if you'd just stick alt tag in there you'd be smiling in macLynx as well...

  11. #11
    SitePoint Enthusiast
    Join Date
    Jun 2002
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sorry... i spaced... you said you were unable to add an alt tag... thats a drag...

  12. #12
    SitePoint Enthusiast
    Join Date
    Jun 2002
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sorry to keep posting these short snips...this worked for me...

    Code:
    <object class="index-guide" data="guide.jpg" type="image/jpeg" width="100" height="66" alt="test"></object>

  13. #13
    SitePoint Wizard Ian Glass's Avatar
    Join Date
    Oct 2001
    Location
    Beyond yonder
    Posts
    2,384
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    CSS's overflow: hidden might work for you but I don't have IE5.5 to test it out.

    Note that in the XHTML 2 working daft, width and height aren't valid attributes. XHTML 1 didn't put any restrictions on the <object> tag that weren't there when it was introduced in HTML 4, to my understanding--it was always meant to eventually replace <img>, I think. Alternate content should be nested in the <object> tag itself. Also, <img>s haven't been removed from XHTML 2, just deprecated. :-)

    I think you're really looking for something more along the lines of this:
    Code:
    <object data="guide.jpg" type="image/jpeg"
      style="overflow: hidden; height: 66px; width: 100px;">
    Alternate text.
    </object>
    ~~Ian
    Last edited by Ian Glass; Sep 27, 2002 at 16:32.


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
  •