SitePoint Sponsor

User Tag List

Results 1 to 15 of 15

Thread: xhtml trans

  1. #1
    SitePoint Zealot bo diddly's Avatar
    Join Date
    Nov 2002
    Location
    uk - worcester
    Posts
    116
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    xhtml trans

    Hi,

    i have built a site using xhtml 1.0 transitional and ran it through the WDG validator and i am getting one error-it picks up the < img height="***" > tag and says that this tag is not supproted in this version. is it ok just to remove the tag?

    thanks

  2. #2
    Incoherent drivel since 1975 Zopester's Avatar
    Join Date
    Feb 2003
    Location
    UK
    Posts
    215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you specified the width too? Remembered your alt attribute? Closed the <img> properly?

    <img src="foo.gif" width="1" height="1" alt="foo" />

    That should be how an XHTML image element should look.

    Hope that helps
    Recommended Reading:
    Why we won't help you - An article by Mark Pilgrim.

    http://www.zopester.com - Coming Soon!

  3. #3
    SitePoint Evangelist S7even's Avatar
    Join Date
    Jun 2002
    Posts
    481
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the img tag is supported, what is not is the height property. You can set the height using css.

  4. #4
    Incoherent drivel since 1975 Zopester's Avatar
    Join Date
    Feb 2003
    Location
    UK
    Posts
    215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the img tag is supported, what is not is the height property. You can set the height using css.
    Beg to differ there S7even. The W3C's own validation page has the following code:


    Code:
    <img height="48" alt="W3C"
    		id="logo" src="<A href="http://www.w3.org/Icons/WWW/w3c_home">http://www.w3.org/Icons/WWW/w3c_home" />
    And the DocType? It's XHTML 1.0 Strict! See the height attribute?

    Transitional is a looser doctype. It supports height too.
    Recommended Reading:
    Why we won't help you - An article by Mark Pilgrim.

    http://www.zopester.com - Coming Soon!

  5. #5
    SitePoint Evangelist S7even's Avatar
    Join Date
    Jun 2002
    Posts
    481
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    right, my mistake

  6. #6
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    also border isn't a tag.

    style="border: 0px;" you need, not border="0"

  7. #7
    SitePoint Zealot bo diddly's Avatar
    Join Date
    Nov 2002
    Location
    uk - worcester
    Posts
    116
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Zopester
    Beg to differ there S7even. [img]images/smilies/smile.gif[/img] The W3C's own validation page has the following code:

    Code:
    <img height="48" alt="W3C"
    id="logo" src="<A href="http://www.w3.org/Icons/WWW/w3c_home">http://www.w3.org/Icons/WWW/w3c_home" />
    And the DocType? It's XHTML 1.0 Strict! See the height attribute? [img]images/smilies/smile.gif[/img]

    Transitional is a looser doctype. It supports height too.
    Zopester thats what i thought too: this is the code: -

    <table width="800" height="693" border="0" cellpadding="0" cellspacing="0" summary="this table is for positioning only">

    an the only error flagged was the height attribute?

  8. #8
    Incoherent drivel since 1975 Zopester's Avatar
    Join Date
    Feb 2003
    Location
    UK
    Posts
    215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tables for positioning! *genuflexes*

    Only joking. I haven't used tables for layout in such a long time that I've forgotten what is and isn't allowed. I believe you have to style the table in CSS. cellpadding and cellspacing are allowed in XHTML Trans though.

    In an ideal world, I'd say lose the table and position with CSS. But I try and stay off my soapbox, especially at this time of the morning!

    also border isn't a tag.

    style="border: 0px;" you need, not border="0"
    someonewhois:

    1. I didn't think anyone was talking about borders, but thanks!
    2. Thing is, in XHTML Trans, border="0" is perfectly acceptable. bo diddly is using Trans.
    Recommended Reading:
    Why we won't help you - An article by Mark Pilgrim.

    http://www.zopester.com - Coming Soon!

  9. #9
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    <table width="800" height="693" border="0" cellpadding="0" cellspacing="0" summary="this table is for positioning only">
    I thought you were talking about images and now a table appears?

    Height isn't allowed in xhtml 1.0 transitional when used in tables. Take out the height and it will validate. You can always use css for the height :

    td { height: 200px;}

    Paul

  10. #10
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Zopester
    ...cellpadding and cellspacing are allowed in XHTML Trans though.

    fwiw, Strict also

    p.s.
    Quote Originally Posted by Zopester
    ...
    Code:
    <img height="48" alt="W3C"
    		id="logo" src="<A href="http://www.w3.org/Icons/WWW/w3c_home">http://www.w3.org/Icons/WWW/w3c_home" />
    WTH is that?
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  11. #11
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Bill Posters
    WTH is that?
    i assume (hope ?) that that was just vBulleting changing the source of the image to be a full URL...otherwise, yes, it's back to basics
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

  12. #12
    Incoherent drivel since 1975 Zopester's Avatar
    Join Date
    Feb 2003
    Location
    UK
    Posts
    215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    WTH is that?
    That's some crappy forum software, that is.
    Recommended Reading:
    Why we won't help you - An article by Mark Pilgrim.

    http://www.zopester.com - Coming Soon!

  13. #13
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I was kinda concerned about the quality of advice being given to apparent newcomers.
    I can quite imagine that post could be as confusing as hell to those who didn't already know enough to spot that something had been balls'd up.

    It would be 'nice' if posters could at least attempt to correct obvious earlier mistakes in their posts when advising those members who aren't quite as 'up to speed' as themselves.

    <dismount />

    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  14. #14
    Incoherent drivel since 1975 Zopester's Avatar
    Join Date
    Feb 2003
    Location
    UK
    Posts
    215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Bill,

    Up until it was pointed out by yourself, I hadn't noticed the "obvious earlier mistake" in my code sample. My bad.

    However, I take issue though with your comment regarding the quality of advice being given. My reason for posting the code sample was to highlight the height attribute in the <img> tag, a point I believe was made effectively, even with the error in code (produced by a script that likes to think it knows what you want).

    In the spirit of doing the right thing, here is how the tag should have looked in the first place:

    Code:
    <img height="48" alt="W3C" id="logo" src="http://www.w3.org/Icons/WWW/w3c_home" />
    I hope my comments aren't taken as a flame. I realise my mistake, but also recognise its importance (or lack thereof) in the context of the question asked. Next time, I'll make sure to double-check my code samples.

    Recommended Reading:
    Why we won't help you - An article by Mark Pilgrim.

    http://www.zopester.com - Coming Soon!

  15. #15
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Don't misunderstand me Zopester.

    I merely thought that, because the erroneous post hadn't been corrected, that you had posted that code knowingly.
    Seeing as the mistake lays with the forum software and not yourself my remarks about the quality of posts no longer apply.
    I completely see how the code posted would have conveyed the point perfectly had it made it past the forum software without first being mangled.

    The only reason I raised the point is that other newcomers looking over this thread might get the wrong impression about acceptible tag structuring (especially when the posted code comes directly from the horse's mouth [namely W3C]).

    Anyway, any misunderstandings have been cleared up now with no harm done.


    Besides, I'd hate to confuse the issue any more than the forum software and bo diddly's transmutational <img>/<table> tag is already doing.

    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature


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
  •