www.webdeveloper.com
Results 1 to 5 of 5

Thread: img or object?

  1. #1
    Join Date
    Jul 2006
    Posts
    3

    img or object?

    Hi guys,
    I'm currently trying to learn xhtml and have a question about the best way to insert images in my documents. The book I'm reading says that <img> is the most widley used but that the official xhtml specifications had intended for the <object> tag to takes it's place.

    Which should I be using in a best practice situation?

    Thanks

  2. #2
    Join Date
    Jun 2004
    Location
    England
    Posts
    2,972
    Both, the reason that the OBJECT element is non-empty is so that you can put alternate content inside, should the browser not be able to handle it.
    Disclaimer. (1) Whilst I will help you sometimes, if I feel like it, and my advice in relation to your actual question will be of good quality: my posts are to be taken with a pinch of salt. I will be sarcastic, deploy irony and include obscure cultural references for my own amusement without warning.
    (2) You will gain nothing from complaining, and if you try to argue with me then you will not win. No matter how noble your battle seems, I am still better than you, don't be an hero.

  3. #3
    Join Date
    Aug 2006
    Posts
    167
    <img> tag should be sufficient and i haven't come across a browser that don't inteprete img tag, but if you want your code to be "nice", you can try <object><img></object>
    ______________
    __________

    ______________
    __________

    ______________
    __________

  4. #4
    Join Date
    Nov 2003
    Location
    Jerryville, Tejas
    Posts
    11,715
    I've got a better idea. Forget XHTML and learn something useful like HTML 4.01 Strict instead.
    "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Brian W. Kernighan

  5. #5
    Join Date
    Jun 2004
    Location
    England
    Posts
    2,972
    Quote Originally Posted by pacerier
    <img> tag should be sufficient and i haven't come across a browser that don't inteprete img tag
    Quote Originally Posted by ray326
    Forget XHTML and learn something useful like HTML 4.01 Strict instead.
    What on earth is the harm in learning both?
    Disclaimer. (1) Whilst I will help you sometimes, if I feel like it, and my advice in relation to your actual question will be of good quality: my posts are to be taken with a pinch of salt. I will be sarcastic, deploy irony and include obscure cultural references for my own amusement without warning.
    (2) You will gain nothing from complaining, and if you try to argue with me then you will not win. No matter how noble your battle seems, I am still better than you, don't be an hero.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles