Remembering the doctypes

Discussion in 'HTML & Website Design' started by whateverandever2, Mar 4, 2009.

  1. #1
    Heya, I am learning html and am at the early stage.

    I wondered how many people know the doctype stuff off by heart?

    For example

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    
    Code (markup):
    Not sure I will be able to remember that by heart!
     
    whateverandever2, Mar 4, 2009 IP
  2. Joak1m

    Joak1m Peon

    Messages:
    135
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    And why should you? What kind of program do you use to program? Most of programs let you choose your doctype. It will make your life so much easier. Or you can add custom keys etc.
     
    Joak1m, Mar 4, 2009 IP
  3. whateverandever2

    whateverandever2 Peon

    Messages:
    881
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Well I am learning in Notepad, and yeah I know DW etc do things automatically but I just wondered how many people knew them by heart etc
     
    whateverandever2, Mar 4, 2009 IP
  4. Joak1m

    Joak1m Peon

    Messages:
    135
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Believe me, notepad is the worst case. If you have anything wrong in your code, it is so hard to find out why and where. There are no line numbers, no colored syntaxing etc. Try Notepad Plus for an example. You will do yourself a big favor ;)
     
    Joak1m, Mar 4, 2009 IP
  5. whateverandever2

    whateverandever2 Peon

    Messages:
    881
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I wil check out Notepad Plus then, thnx
     
    whateverandever2, Mar 4, 2009 IP
  6. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #6
    The W3C actually recommends that you copy-paste from their Doctype site, because it's too easy for errors to creep in if you're typing it yourself. Unless it's the HTML5 doctype:
    <!doctype html>
    lawlz.

    BTW unless your site is a real XML file I'd remove that XML prologue thingie. Yeah, they say to use it because XHTML was intended to really be XML but as Microsoft won't play ball, that idea died. And while IE7 has apparently been trained not to puke at the sight of it, IE6 will go into quirks mode if anything, even a space or that prologue, come before the Doctype.

    Since you are never sending your page out as XML you will never need that prologue.
     
    Stomme poes, Mar 4, 2009 IP
  7. whateverandever2

    whateverandever2 Peon

    Messages:
    881
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Okay, thanks, I am currently reading through 'learn html and css in 24 hours' by Sam's publishing and It told me to put it in, but at moment it's just a 'test' page, but noted anyway.
     
    whateverandever2, Mar 4, 2009 IP
  8. JoshFizgerts

    JoshFizgerts Peon

    Messages:
    93
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I was just going to say that. I used notepad plus (as well as textpad). but now i've moved to DW, completly ignoring all the design and automation WYSIWYG features it includes. It's filestructure and code editor are pretty good. But for css, use FF with that addon (the name isn't coming to me right now).
     
    JoshFizgerts, Mar 4, 2009 IP
  9. Joak1m

    Joak1m Peon

    Messages:
    135
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Jup, same here. I use DW without WYSIWYG, I just like the interface and I feel comfortable there. Even dealing with css is sooo good with DW, but I guess its all about habits :)
     
    Joak1m, Mar 4, 2009 IP
  10. JoshFizgerts

    JoshFizgerts Peon

    Messages:
    93
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Yeah, up till a little while ago, I used DW for css. Like its great and all, its all the same as DW's HTML editor; but CSS is a lot of tweaking and then checking how it looks. And if you use FF with the Web Developer addon, you can edit the CSS is a side-window and see the changes live on your website! Its quite a bit more efficient then changing a value, saving the file, going to the browser, and hitting F5; then repeating, many times ;)
    You should give it a shot, even if you decide not to use it in the end.

    I think nettuts.com has a video tutorial about PSD --> HTML where he uses the addon and explains what it is thats good if your interested, or just go right ahead and try it!
     
    JoshFizgerts, Mar 4, 2009 IP
  11. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Yes, it was originally recommended because the idea was that your page would truly be eXtensible HTML with all this cool XML stuff in it. If you are sending the page as application:xml+xhtml then yes, you'd want that prologue.

    If you look at the W3C Doctype page you'll see they have it also. However they make recommendations based on their standard. They do not mention IE going into Quirks Mode as they don't consider it their business what Microsoft (or any browser vendor) actually does with the specs. And so those of us in the field no longer add that line (you CAN if you don't mind writing a separate stylesheet for IE6 and below with CSS used for the Broken Box Model, and those who must support IE5 or whatever, they actually use the prologue to their advantage for this very reason).

    Otherwise your Sam's book is correct, and IE6 should be the only browser aversely affected by the prologue anyway-- all other browsers ignore it. : )
     
    Stomme poes, Mar 4, 2009 IP