SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 47

Thread: HTML vs XHTML

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2001
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I was told to learn XHTML and stop learning HTML as it is archaic and won't be used on the web within 3 years. Any suggestions?

  2. #2
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    dianna...

    you can actually do both for right now. There is nto a heck of a lot of difference between HTML and xHTML. The major things are that xHTML is MUCH stricter about it's syntax.

    For example:

    1) All tags and attributes must be in lower case.

    2) All values must be quoted.

    3) All tags must have a closing tag. ie:
    <option></option> (this is one that many people don't close)
    and <img src="someimage.jpg></img> (or <img src="someimage.jpg />)

    That ending slash is the important thing. That is a "shortcut" closing tag for certain tags that don't normally get close such as <br> <img> and a few others. You can assure compatibility with older browsers by making sure there is a space between the last part of your tag and the ending bracket like the image tag above. Do you see the space before the last angle bracket?

    xHTML will be fun and it will hopefully help us kill browsers and applications that don't comform to standards (Netscape...cough cough)

    have fun and good luck
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2001
    Location
    UK
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    One other important function of XHTML is that you must nest your tags properly. - as creole says, this will get rid of some of the nonsense browsers out there, and improve the need for fresh codebases for IE and (dare I say it) a cleaner more organised NS codebase.

    Maybe even generated code might look nice too

    *imajes diseapears to utopia...*


    Thanks,
    James

  4. #4
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you're looking fo site ocmpatibility with all the majorbrowsers out thee, stick to html 4.01 first.

    though what you can do to jumpstart your transition in future when netsape 4 users reduce to mere puny fraction...is having:

    1) All tags and attributes in lower case.
    2) All values must be quoted.
    3) format sequence of tags
    4) Usage of CSS

    at this point, you sould have no problem should you need to switch to xhtml standards. =)
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  5. #5
    Team SitePoint AlexW's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne
    Posts
    832
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    AS creole says there isn't a heap of difference between the two so it won't matter too much. If you know one, you'll pick up the other in 30 minutes. There's even software that will do a pretty decent job at XHTML-izing your HTML.

    Personally I think there is waaaay to much useful, hardcoded legacy HTML out there (and more everyday) for there ever to come a day when browsers say "HTML ? what is that?"

    Tens of millions of people know HTML and they will only stop writing it when :

    (a) it's replacement is easier than what they are doing now or
    (b) it delivers so many more benefits they can't afford not to adopt it.

    XHTML isn't really likely to do either of those things, so the take-up rate is likely to be sluggish until most of the WYSIWYG Web products are pumping out XHTML by default. At the point in time it's hard to see what would driving motivation behind that change. The general public isn't crying out for XHTML.
    Alex Walker
    SitePoint Developer
    SitePoint - Learnable

  6. #6
    SitePoint Wizard westmich's Avatar
    Join Date
    Mar 2000
    Location
    Muskegon, MI
    Posts
    2,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    One addition not pointed out is that all attributes need name/value pairs.

    <input checked="checked"></input>

    NOT

    <input checked>
    Westmich
    Smart Web Solutions for Smart Clients
    http://www.mindscapecreative.com

  7. #7
    SitePoint Guru sowen's Avatar
    Join Date
    Feb 2001
    Location
    Stockport, UK
    Posts
    729
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I must admit I am a bit anal in this respect, I was trained as a design engineer and if there is a recognized standard out there I tend to try adhere to it.

    I am also not a hardcore coder, I use Dreamweaver to produce the majority of the html. DW spits out the tags in lower case so that part is easy.

    Run your page through HTMLTidy set to output xhtml, this does the major work like closing tags, showing badly nested elements, quoting all values and some other little tweaks.

    Then validate your page with wc3 that point out anything you might have missed. The biggest problems I tend to find at this point are missing alt attributes for images (remember even spacer gifs' need an alt attribute but if you just double quote - alt="" it won't annoy people using speech browsers)

    And that's it, your page is now XHTML.

    Common sense I know but work with templates / SSI- nail the code in your template and make that valid, cut the weight down rework it till it's perfect. All that work will ripple down through the rest of your site.

  8. #8
    Team SitePoint AlexW's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne
    Posts
    832
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Hi sowen,

    Just interested in you alt tag point.

    I know that you're from a stricted background can't afford the higher levels of tolerance, but how would you justify alt tagging pixel shims on a cost v benefit basis? They don't add any more usability or accessibility to the page (which is why the standard was invented) but they can't help but add extra code overhead.

    Sometimes I think with standards the servant becomes the master.
    Alex Walker
    SitePoint Developer
    SitePoint - Learnable

  9. #9
    SitePoint Guru sowen's Avatar
    Join Date
    Feb 2001
    Location
    Stockport, UK
    Posts
    729
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Alex

    I agree that alt tagging shims is inefficient and will be a code bloater. however...

    I think I am right in saying that shims are mainly used in tables to get the positioning just right, they have very little use outside the <table> tag. WC3's recommendations for tables in XHTML basically say don't use them for layout use them for data! Use the <div> tag instead. The use of div should eliminate the need for shim tags totally QED no need to justify CvB!

    But, at the moment XTHML has a transitional DTD which allows tables for layout. If people start to upgrade their pages to be validated against the Transitional DTD and start alt'ing "shim" everywhere they have a spacer gif, people using speech browsers are going to get mighty pissed off.

    After all that, I have to say I still use tables for layout (hypocrite I know) because support for div is flakey at best, but and here comes anal retentive again, the sooner sites start to code in XHTML the sooner we will have different browsers that render pages EXACTLY the same.

    I think I should say that I am only an 'aspiring' web designer and find it hard enough to get a page looking good using HTML, but that's the point, The less time we have to spend on cross compatibility issues the more time there is to be creative.

    Rant over


    Simon

    Simon

  10. #10
    Team SitePoint AlexW's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne
    Posts
    832
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Pretty fair comments, Simon. We're not all that far apart with our individual approaches.

    The DIV tag is pretty handy and I'm using more and more of them, but, as yet, the control a developer has over them is still limited when compared with tables. Generally I find I'm using tables (technically incorrectly, I know) for the overarching 'framework' of my sites, but using DIV for internal formatting, ...content boxes, features, bullets, text formatting etc.

    One of the guys here (Julian) is actually playing around with a totally table-less version of Sitepoint.com which he wants to use as the basis of an article for the site. It's coming along quite nicely, but there are still some serious headaches to overcome. Even then it will be a reasonably rudimentary rendering of the site.

    In all fairness, I must say that I think the latest versions of the 3 major browsers (IE, NS6, Opera5) do an admirable job of interpreting HTML/CSS in a standards-compliant way. I'm not sure how XHMTL would improve that. Legacy browsers are the problem and I don't think XHTML can help us out much there.
    Alex Walker
    SitePoint Developer
    SitePoint - Learnable

  11. #11
    SitePoint Guru sowen's Avatar
    Join Date
    Feb 2001
    Location
    Stockport, UK
    Posts
    729
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Fair points well taken.

    I am struggling with DIV at the moment, as I said I do my work visually then tweak the (x)html later. Unless I am doing something wrong Dreamweavers (4) support for DIV is almost unintelligible.

    If you guys are doing a DIV version you have to look at this site http://www.iht.com/frontpage.html it is very slick, particularly on the article pages which have no hint of a table.

  12. #12
    SitePoint Wizard
    Join Date
    Apr 2000
    Posts
    1,483
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My new site is written entirely in XHTML - I didn't have to change anything as I decided to use XHTML before I really got going.
    It would be a real pain to convert my existing sites over but for a new one there is no excuse not to use it

  13. #13
    Team SitePoint AlexW's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne
    Posts
    832
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the tip on that IHT.com site. Awesome. It's fantastic to see someone using great design skills to make a site beautifully usable. Everyone here let go with at least one 'ooh' and a couple of 'aahs'

    Interestingly, I pick up echos of K10K.net in the look and feel. K10K are poster-boys of the 'tiny-typed, web Designer set' that usuability gurus like Jacob Nielsen (useit.com) hate. That's a bit like a creationist being inspired by Darwin's Origin of Species.

    Anyway, on the Dreamweaver DIV thing, don't worry, it's not just you. Using DIVs with DW requires a degree of 'Jedi'. You know, using the force, and learning to 'see with your mind' and that sort of thing ,hehehe
    Alex Walker
    SitePoint Developer
    SitePoint - Learnable

  14. #14
    Jules
    SitePoint Community Guest
    Wow!

    Thanks for pointing out iht.com...it's inspirational!

    I see some comments about browsers that don't meet standards such as CSS-1 and HTML 4.01. That rules out N4 and IE4 (among many others).

    How do you guys feel about developing web sites for V5+ browsers? Should we still be building alternative pages for the older (sub-standard) browsers or should we be encouraging users to upgrade?

    Netscape6 and Opera5 are both very good browsers. IE6 is in Beta.

    As developers/designers can we get away with imposing our requirements on Users?

  15. #15
    SitePoint Guru sowen's Avatar
    Join Date
    Feb 2001
    Location
    Stockport, UK
    Posts
    729
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Jules,
    I no what you mean about wow, my estimation of my skills dropped right back down to zero after I saw that. Thanks to capital by the way for pointing it out.

    Your point about designing for the newer browsers. Well that's the whole point, the sooner we all start designing to the standards that are already in place the sooner the browser manufacturers will start to get their act together and follow those standards themselves.

    There must be a place in the market for a group to re-build a browser from the ground up that is totally compliant with the W3 standards and extendable to incorporate new standards as they evolve.

    I withdraw my earlier comment -- rant continues

  16. #16
    Team SitePoint AlexW's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne
    Posts
    832
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Ah,.. but building the browser is the easy part.

    It's trying to coerce people into giving up their safe, known, already-downloaded-and-successfully-installed, browser for a shiny new one.

    That's the toughie.

    Talk to them about 'standards compliance' and their eyes glaze in 1.13 seconds.

    All they're thinking about is that time they installed 'X' new software, and it didn't work, and it crashed their other perfectly good software, and then, when they tried to uninstall it, it made things even worse, and nobody had any idea how to fix it, not even their computer-genius son/friend/colleague, and all they wanted was to have things the way they used to be......

    You get the idea..

    Build it and they will come?

    Probably not.
    Alex Walker
    SitePoint Developer
    SitePoint - Learnable

  17. #17
    SitePoint Guru sowen's Avatar
    Join Date
    Feb 2001
    Location
    Stockport, UK
    Posts
    729
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Now Alex, if Mr Torvalds had had that attitude .........

  18. #18
    Team SitePoint AlexW's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne
    Posts
    832
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Ah, true.. Tell you what. The day that the last AOL user converts to Linux I'll buy you a beer, Simon
    Alex Walker
    SitePoint Developer
    SitePoint - Learnable

  19. #19
    SitePoint Guru
    Join Date
    Jul 2000
    Location
    Long Island, NY
    Posts
    755
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Seriously, though - it's been seeming to me for a little while that in a lot of these discussions there's an assumption of a user base that's a lot more sophisticated in the area of web technologies than is often the case. Maybe the audience is getting too divergent for one size - or even one forum - to fit all when discussing things like this. I'm still having people at work ask me which thing is the browser. Some of them are very computer literate, but have always regarded computers as part of work and not something they enjoy. One kind of interesting, if frustrating, thing about the web is that the audience make-up is always changing. Early adopters were probably all kind of adventurous and got on the web of their own accord. There are a lot more people arriving there kicking and screaming now, because they have to learn about it, not because it's remotely interesting to them.

  20. #20
    SitePoint Guru sowen's Avatar
    Join Date
    Feb 2001
    Location
    Stockport, UK
    Posts
    729
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    AOL .. what's that then

    psalzer,

    the sitepoint communities are aimed at website builders and people who want to learn how to build web sites.

    It seems to me a lot of thought has gone into the layout of the sitepoint forums with subjects for beginners through to really advanced users. Anyone who bothers to post here must by definition be at least slightly interested in the subjects being discussed.

    If i were to rate this thread it would be something like advanced beginner, once you get past the "this is my home page and this is my cat" stage xhtml becomes a relevant subject QED it's in the right place

    These forums are full of fine people who have gone through the process before and are kind enough to share their experiences, may they long suffer amateurs such as myself who aspire to great things

  21. #21
    SitePoint Guru
    Join Date
    Jul 2000
    Location
    Long Island, NY
    Posts
    755
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's not what I meant. I mean that more and more web sites themselves have users who don't particularly enjoy using the technology. It's part of what they have to do. The desire to know about it all, that was there for those of us who were on the web before it was part of everyone's work day is not always there. It's a different mindset. I believe that there is more divergence in the audience for the sites we're learning to build than there was for earlier web sites. When I got on the web there were newbies who wanted to learn, and the people who knew their way around, but everyone (almost) was there because they thought it was an exciting and interesting thing, not because it was a necessity. This is no longer true.

  22. #22
    SitePoint Guru sowen's Avatar
    Join Date
    Feb 2001
    Location
    Stockport, UK
    Posts
    729
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, with you now!

    So, for example, if you want to make sure Windows works right you HAVE to learn how to use the Microsoft web site just so you can update the bugs

  23. #23
    SitePoint Guru
    Join Date
    Jul 2000
    Location
    Long Island, NY
    Posts
    755
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Something like that. People simply have to learn it. It's part of life now for almost everyone. It's just a different head (in some cases) than the people who were on the web, downloading the first copies of Netscape ever because they heard it was better, trying out everything they could, downloading plugins and other software, because it was just interesting. Those people will upgrade a browser just because they want the best experience on the web that they can get and they want to see the newest technology.

    Millions of people, however, continued to use the AOL browser when it was a generation behind in providing support for Java, though.

    And now, with Windows 2000, a lot of people at businesses can't install anything, depending on their permission levels. They might get upgraded when and if the IT department thinks they should.

    I don't know - I think I forgot my original point, but it had something to do with the fact that for some of us it's necessary to look at a web site from the point of view of someone who really doesn't want to be bothered and all. I'd like to use some of the newer things, for instance, but I know that the very people whose site I'm doing are using, at best, the very first 4.0 browsers. I'm beginning to think that designing for one group is an entirely different process than designing for another, at least for the time being.

  24. #24
    Team SitePoint AlexW's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne
    Posts
    832
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    I think you make some good points, psalzer.

    I think there is a wave of easily frustrated 'late adopters' coming online at the moment, but I would make two points are believe are generally true regarding that audience.

    1) They don't get off the 'beaten track' very often. In general, because they don't like or trust the technology at the moment, they don't tend to use it for entertainment. TV still rules their leisure hours. They get in, find whatever it is they need, and get off. This is more likely mean About.com, Yahoo, MSN, CNN, AOL's channels, etc, which are sort of like the web's big tv channels. This will change gradually as they become more confident and sophisticated with their use of the technology.

    2) Late adopters doesn't neccessarily mean really old technology. If your computer was purchased after Fall 97 it should have at least IE4 by default, (which has reasonable CSS support). Although some users do have 'hand-me-down' computers, many have diligently avoided using PC's till now. When they decide it's time to 'get on board', it's almost hard work for them to find a PC running IE3. A secondhand 2 year old computer will most likely have IE5 running on it.
    Alex Walker
    SitePoint Developer
    SitePoint - Learnable

  25. #25
    SitePoint Guru
    Join Date
    Jul 2000
    Location
    Long Island, NY
    Posts
    755
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's very true, about the late adopters having the newest computers. It's always been true, in fact, and it's a very good point.

    I think I'm getting a little frustrated, personally, because most the sites I do are for non-profits or similar organizations. The people that the sites are done for are pretty reluctant and are using their organizations' ancient hardware in some cases, and I know that if I move toward CSS, let alone XHTML they won't be able to see it. Eventually they will, but it could be years yet. But not moving ahead doesn't seem to be the right answer either.And since the kind of users I have aren't lucrative for anyone, there isn't much emphasis about what to do about them.


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
  •