Results 1 to 20 of 20

Thread: XHTML vs. HTML [Resolved]

  1. #1

    Thread Starter
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    XHTML vs. HTML [Resolved]

    I need to be 100% sure on the diffrence tomorrow. Our teacher is not good to explain it. But at the moment I know that.


    HTML:
    <BR>

    XHTML:
    <br />

    In XHTML all the tags has to be with small letters:
    <a> and so on.

    And then there is some thing with a / in the end of the tags. Any one care to elaborate on that, or show me a good link about the diffrences?
    Last edited by NoteMe; Jun 11th, 2004 at 10:02 AM.

  2. #2
    Frenzied Member vbNeo's Avatar
    Join Date
    May 2002
    Location
    Jutland, Denmark
    Posts
    1,994
    Well, the main difference really is that XHTML is more structured, and looks more like XML.

    The <a /> is basically if you make an anchor without any text inbetween the two tags and you want to end it off quick.

    and yes, XHTML is all lowercase, remember that!(unless it's in attributes(" "))

    XHTML is basically clean and structered HTML, which doesn't allow for errors.
    "Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
    - Zack de la Rocha


    Hear me roar.

  3. #3

    Thread Starter
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    Originally posted by vbNeo

    The <a /> is basically if you make an anchor without any text inbetween the two tags and you want to end it off quick.
    So is this an example of this?

    <a input type="checkbox" checked="checked" />

    ???


    Originally posted by vbNeo

    and yes, XHTML is all lowercase, remember that!(unless it's in attributes(" "))
    What do you mena in atributes. Like normal text, or like in the exampel:

    <a input type="checkbox" checked="checked" />

    can I have uppercase here?Like this?
    <a input type="checkbox" Checked="Checked" />


    Didn't sound right.

    Or maybe you mean like for Divs?

    <div class="SOMETHING"> </div>

    didn't sound right that either....or are you just talking plain text that will be on the web site?

  4. #4
    Frenzied Member vbNeo's Avatar
    Join Date
    May 2002
    Location
    Jutland, Denmark
    Posts
    1,994
    Well, What I mean with attributes is a decription, value for example:

    <input type="text" name="txt1" value="ThisIsATextBox" />

    AFAIK the values that are shown to the user can be whatever case they want, as long as they're inside " ", while the type value has to be lowercase.

    I'd recommend taking the www,w3schools.com quiz on XHTML....
    "Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
    - Zack de la Rocha


    Hear me roar.

  5. #5
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    Acceptable: <div id="ICanUseUpperHerer"></div>
    Unacceptable: <DIV ID="ICanUseUpperCaseHere"></div>
    tag names and attribute names should be all lower case. Attribute _values_ can be mixed.

    Also XHTML uses CSS for styling. So it won't allow the style attribute in any tag.

    XHTML also is much more strict than HTML when it comes to ampersands and entity characters (like the copyright or the trademark symbols.)

    TG
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  6. #6

    Thread Starter
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    Originally posted by techgnome
    Acceptable: <div id="ICanUseUpperHerer"></div>
    Unacceptable: <DIV ID="ICanUseUpperCaseHere"></div>
    tag names and attribute names should be all lower case. Attribute _values_ can be mixed.

    Also XHTML uses CSS for styling. So it won't allow the style attribute in any tag.

    XHTML also is much more strict than HTML when it comes to ampersands and entity characters (like the copyright or the trademark symbols.)

    TG

    OK...thanks...things getting clearer now.

  7. #7

    Thread Starter
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    Originally posted by vbNeo
    Well, What I mean with attributes is a decription, value for example:

    <input type="text" name="txt1" value="ThisIsATextBox" />

    AFAIK the values that are shown to the user can be whatever case they want, as long as they're inside " ", while the type value has to be lowercase.

    I'd recommend taking the www,w3schools.com quiz on XHTML....

    Thanks to you too. Will take that quiz later today. Thanks for the hint.

  8. #8
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906
    Originally posted by techgnome
    Also XHTML uses CSS for styling. So it won't allow the style attribute in any tag.
    The style is part of the CSS specification. and is perfectly valid in XHTML.

    The following page is valid XHTML and contains a style attribute:
    http://www.codedv.com/adam/xhtml.html
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  9. #9

    Thread Starter
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    Originally posted by visualAd
    The style is part of the CSS specification. and is perfectly valid in XHTML.

    The following page is valid XHTML and contains a style attribute:
    http://www.codedv.com/adam/xhtml.html

    Yeah I just read abou that. And that it has the highest presidens of all the styles. But I have also heard that if you are using both methods you can confuse IE...never seen that for my own eyes tho'...

  10. #10
    Frenzied Member vbNeo's Avatar
    Join Date
    May 2002
    Location
    Jutland, Denmark
    Posts
    1,994
    Originally posted by NoteMe
    Yeah I just read abou that. And that it has the highest presidens of all the styles. But I have also heard that if you are using both methods you can confuse IE...never seen that for my own eyes tho'...
    Might be because it's just a browser, that parses a file and therefore is not capable of a human thing such as getting confused ? =)
    "Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
    - Zack de la Rocha


    Hear me roar.

  11. #11
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906
    Originally posted by NoteMe
    Yeah I just read abou that. And that it has the highest presidens of all the styles. But I have also heard that if you are using both methods you can confuse IE...never seen that for my own eyes tho'...
    The style attribute takes precedance over all the other styles and overrides them.

    I don't see why IE should worry about it. As long as you include the DOCTYPE at the top of the page IE should render it OK.

    But this is Internet Explorer so nothing is surprising
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  12. #12

    Thread Starter
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    Originally posted by vbNeo
    Might be because it's just a browser, that parses a file and therefore is not capable of a human thing such as getting confused ? =)

    You stupid..:...just kidding...I like to use the name confused with parsers and compilers. Love when gcc tells me there is some errors, and then bails out to find the rest becuase "compiler bails out becasue it got confused of earlier errors"..

  13. #13
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    There are two levels of differences between HTML and XHTML.

    First, the syntactical/structural. That's the stuff that has been handled and is due to the underlying meta-language, SGML vs XML: all tags must have a matching end tag or be directly closed (/>). All tag names and attribute names are lowercase, some predefined attribute values are case-sensitive too, like the type attribute of input. Attribute values must have quotes around them. Tags must be well-nested, <em>asd<strong>as</em>po</strong> is not allowed.

    Then there's the design philosophy level. XHTML follows the same philosophy as HTML 4 Strict, that is, the (X)HTML is only to give the document structure. Semantical markup. HTML was originally conceived to give parts of the text semantical meaning, to indicate the parts that are paragraphs, those that are emphasized, strongly emphasized, code, user input, ...
    Extensions during the browser wars brought style to HTML. Tables for layout, <b>, <i>, <font>.
    HTML 4 Strict and XHTML feature a return to the basics. They don't have the presentational elements and attributes anymore (XHTML 1.0 Transitional still has them, and there's a presentation module in the modularized XHTML 1.1) but instead rely completely on external style sheets (usually CSS) to give the page presentation.

    That's the idea.


    And yes, IE can get confused. The way the word is usually applied to computers and software, anyway.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  14. #14

    Thread Starter
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    Yeah thanks for that. I am pretty new to this, so I still can't see the whole point about having diffrent types of DTD(was that was it was called) like strickt and transitional and so on. But I don't think I will get questions about that.


    But there is an other thing. Not sure if it has something to do with XHTML, but in the quiz it said that atribute "minimazation" is not allowed in XHTML. And I think that the validator are complaining about href becuase of this:


    an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified

    <a class="linker" href=cd2.php?CDID=44>Les Mer</a>


    Can anyone correct this line so it is true XHTML? I thought this was prefecctly legal....

  15. #15
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906
    Originally posted by NoteMe
    <a class="linker" href=cd2.php?CDID=44>Les Mer</a>


    Can anyone correct this line so it is true XHTML? I thought this was prefecctly legal....
    The href attribute value needs to be enclosed in quotes:
    Code:
    <a class="linker" href="cd2.php?CDID=44">Les Mer</a>
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  16. #16
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    but in the quiz it said that atribute "minimazation" is not allowed in XHTML.
    That's a two-part issue.
    One part is the quote stuff already mentioned.
    The other is about enum values that have only one possible value, such as the selected attribute on <option>. It is declared as an #IMPLIED (= optional) attribute of type (selected), i.e. an enum with its only valid value being "selected".
    Now, HTML allows such attributes to omit the value, e.g.
    <option selected>
    That's not allowed in XHTML, you must write the full
    <option selected="selected">
    Stupid, I know.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  17. #17

    Thread Starter
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    Originally posted by CornedBee
    That's a two-part issue.
    One part is the quote stuff already mentioned.
    The other is about enum values that have only one possible value, such as the selected attribute on <option>. It is declared as an #IMPLIED (= optional) attribute of type (selected), i.e. an enum with its only valid value being "selected".
    Now, HTML allows such attributes to omit the value, e.g.
    <option selected>
    That's not allowed in XHTML, you must write the full
    <option selected="selected">
    Stupid, I know.

    Actualy, I don't find it that stupid....well it is more to write, but it looks cleaner. it's some how a bit similar to write $ and % and so on in stead of Stringg, Souble and so on. I like it to be clean.

    Tahnks for the explenation...

  18. #18

    Thread Starter
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    Originally posted by visualAd
    The href attribute value needs to be enclosed in quotes:
    Code:
    <a class="linker" href="cd2.php?CDID=44">Les Mer</a>

    Off course..

    I thought it was more the haw I added the whole href, like it should have been an other word or something..

    Thanks.

  19. #19
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    <a class="linker" href="cd2.php?CDID=44">Les Mer</a>

    This narrowly avoids another issue. If the URL was
    cd2.php=CDID=44&inquirer=100
    then the tag would have to be (and I have to be careful now with vBulletin transformations)
    <a class="linker" href="cd2.php?CDID=44&amp;amp;inquirer=100">Les Mer</a>

    Edited, it's now completely correct. This applies to HTML as well, btw.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  20. #20

    Thread Starter
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    Thanks didn't think of that "scenario" at all. Well my head is full of XHTML, CSS, PHP, and JS now. So I am on my way to bed, and tomorrow is the big day.

    Thanks to all of you who has helped me.


    ØØ

Posting Permissions

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



Click Here to Expand Forum to Full Width