SitePoint Sponsor

User Tag List

Page 3 of 7 FirstFirst 1234567 LastLast
Results 51 to 75 of 160
  1. #51
    SitePoint Wizard
    Join Date
    Dec 2003
    Location
    USA
    Posts
    2,582
    Mentioned
    29 Post(s)
    Tagged
    0 Thread(s)
    Ummm....

    XHTML 1.0: The Extensible HyperText Markup Language (Second Edition)

    C.2. Empty Elements

    Include a space before the trailing / and > of empty elements, e.g. <br />, <hr /> and <img src="karen.jpg" alt="Karen" />. Also, use the minimized tag syntax for empty elements, e.g. <br />, as the alternative syntax <br></br> allowed by XML gives uncertain results in many existing user agents.
    Unless I'm reading that backwards, it says to include the space. It's not necessarily required, but it is recommended.

    Also, what do you wish you could believe? That I have taught and done (and am still involved in at a different level) curriculum development?

    I agree that you should challenge a student. However, there is a difference between giving a kindergartener a Calculus III problem and giving a college student a critical thinking problem. You can't challenge a student if they have no information yet. Let them grasp the simple basics first, then push that information and their knowledge further with challenges. Giving a student a challenge they are prepared for and trying to give them a BS in Computer Science worth of information on day 1 are two very different things.

    I've never thought a student too dumb to do what is required and I would frequently challenge my students to solve problems that I never directly taught, but that they had the ground work for... requiring them to think outside of the box.

  2. #52
    Non-Member
    Join Date
    Jun 2010
    Location
    4727′35″N 2618′0″E
    Posts
    1,789
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You're again quoting something wrong.

    The actual definition in XHTML for empty elements:
    XHTML 1.0 - Differences with HTML*4
    4.6. Empty Elements

    Empty elements must either have an end tag or the start tag must end with />. For instance, <br/> or <hr></hr>. See HTML Compatibility Guidelines for information on ways to ensure this is backward compatible with HTML 4 user agents.

    CORRECT: terminated empty elements

    <br/><hr/>

    INCORRECT: unterminated empty elements

    <br><hr>
    Yours are from HTML Compatibility Guidelines. Which you should have being able to admit, not to spin.

    I am stopping my part in this thread here. But the commotion was necessary: it does make a difference whether you know that your code is eihter HTML 4.01, either XHTML 1.0 or HTML5. Or HTML-Frankenstein. There are differences, and those differences are significant in more than one way. The sooner the newbie knows that, the better.

    Surprisingly enough, even though HTML5 was meant to be the easy joyride for everyone to learn html, it still looks like HTML 4.01 is the answer for starting off. Two specs, html and xhtml in one, a lot of mixed semantics, all these and many other make for a hard to achieve correct and semantic HTML5 web page. But sloppy inept pages existed long before HTML5, so it's nothing the web dev hasn't seen yet.

  3. #53
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,863
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by markbrown4 View Post
    Isn't it just easier not ever mentioning what "True XHTML" is?
    No one serves their XHTML as XML do they?

    I find the whole argument moot.
    Why would you serve XHTML as XML? Even though all versions of IE do support it being served that way it makes even less sense to do so than it does to serve it as HTML since you lose all the benefits of using a web based arrangement if you do that.

    As long as you are prepared to ignore IE8 and earlier you can serve XHTML as XHTML rather than as HTML or XML and get all the benefits that provides.

    The type of page is determined by the MIME type and not the doctype. You can use an XHTML doctype and serve the page as HTML or XML and you effectively just have malformed HTML that the browsers will fix or XML that needs all the extra things any XML does to display properly. XHTML only works properly as XHTML if you give it the XHTML MIME type and the only problem with doing that is that IE8 and earlier do not understand that one and so offer the file for download.

    XHTML will become practical once IE8 dies and the benefits that it will provide should see a lot of people switch to using it at that time.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  4. #54
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,863
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by samanime View Post
    Unless I'm reading that backwards, it says to include the space. It's not necessarily required, but it is recommended.
    The space is required if you want to serve the page as HTML and have it work in Netscape 4. It is not necessary in more modern browsers such as IE4 etc.

    So unless you need to support Netspace 4 and want to also be prepared for when IE8 dies then you don't need the space. If you are not waiting for IE8 to die so you can switch to using XHTML then you don't need the / either.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  5. #55
    SitePoint Wizard
    Join Date
    Dec 2003
    Location
    USA
    Posts
    2,582
    Mentioned
    29 Post(s)
    Tagged
    0 Thread(s)
    Yeah, it's not required. But it's not invalid either, is it? I personally put the space there just for appearance when coding (old habit, so <br/> looks odd to me, though I do usually minify it out).

  6. #56
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,863
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Stormrider View Post
    IE8 doesn't support XHTML, but what does that have to do with learning it?
    IE9 does support XHTML and so once IE8 is dead there will no longer be any reason why pages will not be able to be served properly as XHTML.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  7. #57
    SitePoint Wizard silver trophybronze trophy Stormrider's Avatar
    Join Date
    Sep 2006
    Location
    Nottingham, UK
    Posts
    3,133
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    No, but that is just about technicalities again and how you USE the language, nothing to do with the syntax of the language, which is the main thing you need to know about when you are learning it. Which is why I agree the main difference to someone learning the language is the self-closing tags thing (and with that, making sure all tags are closed, rather than omitted like is possible with some elements in html).

  8. #58
    SitePoint Wizard
    Join Date
    Dec 2003
    Location
    USA
    Posts
    2,582
    Mentioned
    29 Post(s)
    Tagged
    0 Thread(s)
    To illustrate the point Stormrider is trying to make, consider this. If you were going to teach a person to brew their own coffee in a coffee maker, would you:
    - Teach the person to put in the coffee, add water, and press the button.
    - Teach them how the hot water cooks the coffee grounds and releases the flavor of the coffee which is then detected by your taste buds when you drink it, etc. (just made that stuff up, but you get the point =p).

    Eventually you might teach them all the fancy stuff that's going on behind the scenes... but first they need to know where to put the coffee grounds and water.

  9. #59
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,863
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Stormrider View Post
    No, but that is just about technicalities again and how you USE the language, nothing to do with the syntax of the language, which is the main thing you need to know about when you are learning it. Which is why I agree the main difference to someone learning the language is the self-closing tags thing (and with that, making sure all tags are closed, rather than omitted like is possible with some elements in html).
    You can use self closing tags with HTML because HTML will ignore the / in the end of tags where it doesn't need it. You don't even need a space before the / for the browser to ignore it in HTML (unless the browser is Netscape 4).

    The only difference when you put those unnecessary slashes in your HTML is that you would need to select an XHTML doctype if you validate the page and do not want them being reported as errors.

    There is no reason why if you are using HTML why you couldn't use the short version of the doctype and just include the closing shalshes anyway. The long version of the doctype is only used by the validator and you can specify the doctype you want to validate against in the validator rather than needing to specify it in the web page. Browsers completely ignore the content of the doctype when processing HTML - all they look for is that the page has a doctype in order to work out whether the page follows the standards or whether it was written for IE5 which implemented a pre-release version of the box model that was changed before CSS2 was finished.

    All the extra things you need to take into account if you are going to really use XHTML instead of just using its self-closing tags in your HTML are not really relevant until such time as you decide to abandon all your visitors using IE8 or earlier.

    One of the ways in which HTML 5 improves on HTML 4 is that it actually allows the closing slashes to be validly added in HTML since it makes no difference to HTML whether they are there or not and so it allows all tags to be closed in HTML as well as requiring all tags to be closed in XHTML.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  10. #60
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,116
    Mentioned
    28 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by noonnope View Post
    I wish I could believe you.

    This makes me scream: "Please STOP! No more FALSE INFO!!!" Valid XHTML means only the closing tag? Which, if it's <br />, it's not even valid XHTML, it should be <br/>? You are so wrong I could ask for my money back!

    Feeding wrong information may be your thing when teaching, not mine. Yeah, that's right, I used to be a teacher.

    And no, starting off with the correct info, that's what makes a student tick. Challenge him constantly. Playing him for a stupid doesn't work so much, unless your students are preschool. Learning that you thought he was too dumb to understand some pretty basic stuff will only tick him off. He will take it as he should: you didn't have enough info to make it simpler to understand, and chose to feed him false info instead.

    And finally, please admit you were giving FALSE and WRONG info, and let's be done with it.

    I know I'm done with it. I'm a stubborn man my self, and it shows here on SPF plenty, but I don't enjoy being stubborn just to be right. I defend an idea so that others may go harder against it and give good reasoning and understanding to change my mind where I'm wrong. Hiding ignorance it's not the same with knowledge testing in the process of learning. I'm not hiding my ignorance, I show it so I can learn.
    noonnope, I find samanime's advice in thread replying to the OP far more helpful than yours.

    What you and felgall know about "What XHTML Really Is" simply doesn't matter in the scheme of things, which is why I find these threads so boring.

    --

    The best way to write HTML today is to start here:
    Code:
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>HTML ftw</title>
    <meta name="description" content="Put something meaningful here">
    <link rel="shortcut icon" href="/favicon.ico">
    <link rel="stylesheet" href="css/style.css">
    </head>
    <body>
    
    <script src="js/script.js"></script>
    </body>
    </html>
    • Learn HTML - Either HTML 4 strict / or XHTML 1.0 strict - it doesn't matter.
    • Learn CSS
    • Learn Javascript
    • Learn about what's been added in HTML5 & CSS3

  11. #61
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,116
    Mentioned
    28 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by felgall View Post
    XHTML will become practical once IE8 dies and the benefits that it will provide should see a lot of people switch to using it at that time.
    What benefits?

  12. #62
    SitePoint Member
    Join Date
    Aug 2010
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by markbrown4 View Post
    • Learn HTML - Either HTML 4 strict / or XHTML 1.0 strict - it doesn't matter.
    • Learn CSS
    • Learn Javascript
    • Learn about what's been added in HTML5 & CSS3
    Thanks, that was very helpfull.

  13. #63
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,863
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by markbrown4 View Post
    • Learn HTML - Either HTML 4 strict / or XHTML 1.0 strict - it doesn't matter.
    If you are going to serve it as HTML them it doesn't matter which of those two doctypes you use as it will still be HTML 4 that you are using. Only if you serve XHTML 1.0 as XHTML is it different - and then there are lots more differences than just a few extra /.

    Quote Originally Posted by markbrown4 View Post
    What benefits?
    Just one example: XHTML will let you know if you have made an error in the XHTML by not displaying the page. That way you can make sure the error if fixed before you upload the page to the web. You always know that your XHTML on the web is valid and so don't need to hope that all browsers will handle anything that is invalid the same way.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  14. #64
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,116
    Mentioned
    28 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by felgall View Post
    Just one example: XHTML will let you know if you have made an error in the XHTML by not displaying the page. That way you can make sure the error if fixed before you upload the page to the web. You always know that your XHTML on the web is valid and so don't need to hope that all browsers will handle anything that is invalid the same way.
    Most people would see that 'feature' of XHTML as a drawback.

    I was really surprised you said that many people would start to see the benefits of XHTML when IE 8< is dead. I thought serving pages as XHTML died a long time ago.

  15. #65
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,863
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by markbrown4 View Post
    Most people would see that 'feature' of XHTML as a drawback.
    Yes, those who don't really care whether their page will display correctly in ALL browsers would see proper validation as a drawback. Those professionals who want to reduce the time they spend on validating pages will see it as a huge benefit - if the page displays it is valid, only if it doen't display do you then have to spend the extra time to run it through the validator to find the error(s).

    Quote Originally Posted by markbrown4 View Post
    I thought serving pages as XHTML died a long time ago.
    Since it hasn't really been born yet it can't have died a long time ago.

    Once IE8 is dead both XHTML 1.0 and XHTML5 will become possible and then people might start using them.

    If XHTML died a long time ago then why is a new version currently being created alongside the new HTML version? If it were dead then a new version wouldn't be under development.

    Now XHTML 2.0 did die a while back as it was too radically different from anything that had come before and it looked very much like no browser was even considering the possibility of implementing support for it.

    XHTML 1.0 is as well supported by the latest versions of all browsers as HTML 4 is. It is only old versions of IE that don't support it. It is just a pity that the latest version of IE doesn't run on Windows XP as that will slow down people being able to upgrade to the latest version which has just implemented XHTML support (why would Microsoft have just implemented something that is long dead - because it isn't long dead).

    XHTML 5 should be as well supported as HTML 5 is since they are being developed in parallel and browsers have no reason why they'd implement one variant and not the other.

    XHTML certainly isn't long dead. Today is the first day where the latest versions of ALL browsers finally support it. XHTML has finally today begun its birth process and just needs to wait for IE8 and earlier to die out so as to finish being born.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  16. #66
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    Off Topic:

    If you use XHTML5 it MUST be served as an application of XML so XHTML5 is NOT backwards compatible unlike 'XHTML 1.0 Transitional' (it's XHTML 2.0 that got discontinued) NOT XHTML.

    Probably now calling itself just HTML. How the future browser will trigger the XML processor might be interesting though.

  17. #67
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,863
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by xhtmlcoder View Post
    Off Topic:

    If you use XHTML5 it MUST be served as an application of XML so XHTML5 is NOT backwards compatible .
    Does that mean that XHTML 5 can be served either as XML or as XHTML but not as HTML (given that XHTML is an application of XML)?

    Since IE9 claims to support the current version of the proposed standard has anyone had time to test it yet to see how it handles XHTML 5?

    To bring it back on topic - now that all the latest browsers do support XHTML it should have some impact on the usefulness of learning XHTML as an addition to learning HTML. There is no longer any doubt that it will be possible to use it for web pages at some point in the future.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  18. #68
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,116
    Mentioned
    28 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by felgall View Post
    To bring it back on topic - now that all the latest browsers do support XHTML it should have some impact on the usefulness of learning XHTML as an addition to learning HTML. There is no longer any doubt that it will be possible to use it for web pages at some point in the future.
    You just add trailing slashes

  19. #69
    SitePoint Member
    Join Date
    Mar 2011
    Location
    FL
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am also a beginner and I am trying to learn more first about html 4.01. My friend told me that I need to learn it first the platform of html 4.01.

  20. #70
    SitePoint Evangelist happyoink's Avatar
    Join Date
    Jan 2008
    Location
    UK
    Posts
    503
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My opinion is that the OP should learn HTML 4.01 Strict first. There is no need to learn HTML5 or XHTML, at least, not until after the OP has become competent in writing HTML 4.01 using a Strict doctype.

    I don't use HTML5, because I've not yet needed to use its new features, such as canvas and other features. Until then, I'm sticking with HTML4. I can't see why a beginner would need to learn HTML5 right away.

    XHTML is an application of XML. Therefore there is little need for a beginner to use it, unless he has a good reason for doing so.

    So, these are my basic reasons for why I recommend the OP forgets about HTML5 and XHTML until he has become competent in HTML 4.01. I believe others have already covered other reasons why HTML 4.01 is best to start with.

  21. #71
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,863
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by markbrown4 View Post
    You just add trailing slashes
    No - that is HTML with surplus slashes - it is NOT XHTML.

    If the MIME type is text/html then it is HTML regardless of whether the trailing slashes are there or not and regardless of what doctype you use.

    I use the XHTML doctype on all the pages of my web site even though all but one of the pages are just HTML. That is simply because I prefer using the XHTML validator to validate my HTML 4.01 rahter than using the HTML one. The only page that I have that uses XHTML is Real XHTML which is a web page I set up to demonstrate exactly how XHTML differs from HTML.

    Try accessing that web page in an old version of IE and you will see why web pages are not yet able to be created using XHTML, try it in IE9 or some other web browser and you will see how once IE8 and earlier die out that XHTML will then be usable for web pages.

    Just because a web page uses an XHTML doctype and extra slashes doesn't mean you are not using HTML 4.01 for your page. The XHTML doctype and the extra slashes are allowed to be used with HTML 4.01 provided you restrict yourself to the subset of XHTML 1.0 that works as HTML.

    If we paint you green does that mean that you are grass and not a person? No, and neither does using an XHTML doctype and extra slashes make your page XHTML if you are still using the text/html MIME type.

    If the MIME type is text/html then the browser will treat whatever you put in your web pages as being whatever version of HTML that the browser is designed to understand and will ignore anything that doesn't match that version. So if you run your web page in IE7 then the version of HTML that is used is IE7-HTML regardless of the doctype.

    The point about the HTML 4.01 standard is that it represents the subset that all the different browser HTMLs (post Netscape 4) have in common. No browser makes any use of the doctype in processing the HTML whatsoever (some do use it as a switch to determine how to interpret some CSS but the actual version information is completely ignored).
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  22. #72
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    Hmm.
    Quote Originally Posted by Stephen
    Does that mean that XHTML 5 can be served either as XML or as XHTML but not as HTML (given that XHTML is an application of XML)?
    XHTML5 is the XML serialization of HTML5. When I last looked at the Draft that was the case: 'application/xhtml+xml' or 'text/xml' 'application/xml' were the only options for XHTML5, which makes total sense. XHTML5 requires XML's strict, well-formed syntax anyway.

    I'd be interested to see how IE9 handles XHTML well-formedness errors if somebody wants to try? As I don't have the facilities to install it myself.

  23. #73
    SitePoint Wizard silver trophybronze trophy Stormrider's Avatar
    Join Date
    Sep 2006
    Location
    Nottingham, UK
    Posts
    3,133
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    It does nothing. I copied Stephen's example and removed the closing </p> tag. Firefox complains, as it should, IE9 displays the page anyway.

    http://www.cemerson.co.uk/xhtml.php

  24. #74
    SitePoint Guru Jason__C's Avatar
    Join Date
    Oct 2009
    Location
    Racoon City
    Posts
    660
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Stormrider View Post
    It does nothing. I copied Stephen's example and removed the closing </p> tag. Firefox complains, as it should, IE9 displays the page anyway.

    Real XHTML
    I thought their we're no HTML cross-platform issues? ZING!

  25. #75
    SitePoint Guru Jason__C's Avatar
    Join Date
    Oct 2009
    Location
    Racoon City
    Posts
    660
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Michael Morris View Post
    They've already done this. It's called the W3C.

    (The humor in contrasting your first statement with your second is too good to pass up).
    Glad you Cherry Picked my comments. Now, if you would have read all of my comments you would have found out the difference between the two. On one hand, you have a non-profit, recommendation committy . On the other hand, you have for-profit, browser making Corporations. See the difference? ZING!


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
  •