Minimal HTML

Discussion in 'HTML' started by Toby Inkster, Nov 24, 2004.

  1. Toby Inkster

    Toby Inkster Guest

    Today's challenge is to create the smallest *valid*[1] HTML file possible.

    So far I have one that's 60 bytes, but I reckon someone here must be able
    to do better!

    [1] validated by the W3C validator in any DOCTYPE that it understands. It
    must be declared as valid with no manual over-rides and no "Tentatively".

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
     
    Toby Inkster, Nov 24, 2004
    #1
    1. Advertising

  2. Toby Inkster wrote:

    > Today's challenge is to create the smallest *valid*[1] HTML file possible.
    >
    > So far I have one that's 60 bytes


    Oh dear. HTML Golf. I'm doomed.

    I can't seem to beat 68 bytes.

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
     
    David Dorward, Nov 24, 2004
    #2
    1. Advertising

  3. On Wed, 24 Nov 2004 21:56:10 +0000, Toby Inkster
    <> wrote:

    [snip]

    > So far I have one that's 60 bytes, but I reckon someone here must be
    > able to do better!


    Presumably,

    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><title//.

    which is 55 bytes is the smallest possible.

    Is there a prize? :)

    Mike


    By the way, I validated this off my own web server, so I'm reluctant to
    give a URL: the server is for personal testing purposes only as I'm on
    dial-up. If anyone does know how to configure Zeus to send the encoding
    along with content-type, I could put it on my ISP's web server.

    --
    Michael Winter
    Replace ".invalid" with ".uk" to reply by e-mail.
     
    Michael Winter, Nov 24, 2004
    #3
  4. Toby Inkster

    Mark Parnell Guest

    Previously in alt.html,alt.www.webmaster, Toby Inkster
    <> said:

    > Today's challenge is to create the smallest *valid*[1] HTML file possible.
    >
    > So far I have one that's 60 bytes, but I reckon someone here must be able
    > to do better!


    Nope, best I can do is 61 bytes. Well, it only tentatively validates,
    but that's only because my host won't send out a character encoding with
    the page. :-/

    --
    Mark Parnell
    http://www.clarkecomputers.com.au
     
    Mark Parnell, Nov 24, 2004
    #4
  5. Toby Inkster

    Mark Parnell Guest

    Previously in alt.html,alt.www.webmaster, Michael Winter
    <> said:

    > <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><title//.
    >
    > which is 55 bytes is the smallest possible.


    Nicely done.

    > If anyone does know how to configure Zeus to send the encoding
    > along with content-type, I could put it on my ISP's web server.


    Sorry, I have exactly the same problem. :-( If you find out, let me
    know. :)

    --
    Mark Parnell
    http://www.clarkecomputers.com.au
     
    Mark Parnell, Nov 24, 2004
    #5
  6. Michael Winter wrote:
    > <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><title//.


    Self-closing tags. Of course!

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
     
    David Dorward, Nov 24, 2004
    #6
  7. Toby Inkster

    rf Guest

    Michael Winter

    > Presumably,
    >
    > <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><title//.
    >
    > which is 55 bytes is the smallest possible.


    Fires quirks mode in a certain browser.

    --
    Cheers
    Richard.
     
    rf, Nov 24, 2004
    #7
  8. On Wed, 24 Nov 2004 23:17:13 GMT, rf <rf@.invalid> wrote:

    > Michael Winter
    >
    >> Presumably,
    >>
    >> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><title//.
    >>
    >> which is 55 bytes is the smallest possible.

    >
    > Fires quirks mode in a certain browser.


    Toby said nothing about utility, just validity. :p

    For the record, none of the browsers I have to hand at the moment parse
    that "document" properly. Gecko browsers seem to act the most
    intelligently, but they still fail to produce the expected tree.

    Anyway, someone mind telling me the point of this? :)

    Mike

    --
    Michael Winter
    Replace ".invalid" with ".uk" to reply by e-mail.
     
    Michael Winter, Nov 24, 2004
    #8
  9. Toby Inkster

    Toby Inkster Guest

    Michael Winter wrote:

    > <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><title//.


    Dammit. Mine was:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"><title//<p>

    I also had:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><title//.

    But in strict you can't use "<title//." because the body element isn't
    allowed to contain inline text -- only block elements.

    Good choice of DOCTYPE too. I couldn't think of a shorter one than HTML
    4.0.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
     
    Toby Inkster, Nov 24, 2004
    #9
  10. Toby Inkster

    Duende Guest

    While sitting in a puddle Michael Winter scribbled in the mud:

    >> Michael Winter
    >>
    >>> Presumably,
    >>>
    >>> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><title//.
    >>>
    >>> which is 55 bytes is the smallest possible.

    >>
    >> Fires quirks mode in a certain browser.

    >
    > Toby said nothing about utility, just validity. :p
    >
    > For the record, none of the browsers I have to hand at the moment parse
    > that "document" properly. Gecko browsers seem to act the most
    > intelligently, but they still fail to produce the expected tree.
    >
    > Anyway, someone mind telling me the point of this? :)


    beats working.

    --
    Avoid reality at all costs.
     
    Duende, Nov 24, 2004
    #10
  11. "Michael Winter" <> wrote:

    > <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><title//.
    >
    > which is 55 bytes is the smallest possible.


    Somewhat debatably, no. If you replace PUBLIC with SYSTEM and the quoted
    string with a quoted URL that points to the HTML 2.0 DTD, you get a
    shorter document if you can get a short enough URL. I have no
    sufficiently short URL right now at my disposal, but the following is a
    proof of concept:

    <!DOCTYPE HTML SYSTEM
    "http://www.w3.org/MarkUp/html-spec/html-1.dtd"><title//.

    So if you replace the quoted string by an absolute URL that redirects to
    the same address, or points to a copy of the DTD, you should get below 55
    bytes. I wonder if some http://x.xx (where x's are letters) would be
    available for this important purpose.

    It would still be a conforming HTML 2.0 document, since HTML 2.0 requires
    conformance to the HTML 2.0 DTD, not the use of a particular DOCTYPE
    declaration (or any DOCTYPE declaration for that matter - but the
    assignment said the validator should accept the document by its default
    rules).

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
     
    Jukka K. Korpela, Nov 25, 2004
    #11
  12. On Thu, 25 Nov 2004 00:02:20 +0000 (UTC), Jukka K. Korpela
    <> wrote:

    > "Michael Winter" <> wrote:
    >
    >> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><title//.
    >>
    >> which is 55 bytes is the smallest possible.


    You're the second person to quote me that way. The first word I wrote was
    "Presumably". I was certain that someone could outdo me...

    > [...] If you replace PUBLIC with SYSTEM and the quoted string with a
    > quoted URL that points to the HTML 2.0 DTD, you get a shorter document
    > if you can get a short enough URL.


    ....and I was right.

    [snip]

    Mike

    --
    Michael Winter
    Replace ".invalid" with ".uk" to reply by e-mail.
     
    Michael Winter, Nov 25, 2004
    #12
  13. On Wed, 24 Nov 2004 23:57:45 +0000, Toby Inkster
    <> wrote:

    > Michael Winter wrote:
    >
    >> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><title//.


    [snip]

    > But in strict you can't use "<title//." because the body element isn't
    > allowed to contain inline text -- only block elements.


    I know, which was why I avoided it. Besides, it would have made the
    DOCTYPE declaration longer.

    > Good choice of DOCTYPE too. I couldn't think of a shorter one than HTML
    > 4.0.


    To be honest, neither could I at first so I thought I'd do the sensible
    thing and look at the list of accepted DOCTYPEs
    (<URL:http://www.w3.org/QA/2002/04/valid-dtd-list.html>) for the W3C
    Validator and used the shortest. :D

    Mike

    --
    Michael Winter
    Replace ".invalid" with ".uk" to reply by e-mail.
     
    Michael Winter, Nov 25, 2004
    #13
  14. Toby Inkster

    Toby Inkster Guest

    Michael Winter wrote:

    > To be honest, neither could I at first so I thought I'd do the sensible
    > thing and look at the list of accepted DOCTYPEs
    > (<URL:http://www.w3.org/QA/2002/04/valid-dtd-list.html>) for the W3C
    > Validator and used the shortest. :D


    I looked at that list too, but the one you used isn't there. You have to
    click through to the HTML 2.0 DTD to find it.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
     
    Toby Inkster, Nov 25, 2004
    #14
  15. Toby Inkster

    Nullcode Guest

    Jukka K. Korpela wrote:

    > "Michael Winter" <> wrote:
    >
    >
    >> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><title//.
    >>
    >>which is 55 bytes is the smallest possible.

    >
    >
    > Somewhat debatably, no. If you replace PUBLIC with SYSTEM and the quoted
    > string with a quoted URL that points to the HTML 2.0 DTD, you get a
    > shorter document if you can get a short enough URL. I have no
    > sufficiently short URL right now at my disposal, but the following is a
    > proof of concept:
    >
    > <!DOCTYPE HTML SYSTEM
    > "http://www.w3.org/MarkUp/html-spec/html-1.dtd"><title//.
    >
    > So if you replace the quoted string by an absolute URL that redirects to
    > the same address, or points to a copy of the DTD, you should get below 55
    > bytes. I wonder if some http://x.xx (where x's are letters) would be
    > available for this important purpose.
    >
    > It would still be a conforming HTML 2.0 document, since HTML 2.0 requires
    > conformance to the HTML 2.0 DTD, not the use of a particular DOCTYPE
    > declaration (or any DOCTYPE declaration for that matter - but the
    > assignment said the validator should accept the document by its default
    > rules).
    >


    Damnit, I played with SYSTEM, but i neve rthought about changing the url :(

    --
    Nullcode
    "Suffering is a result of desire"
    bnVsbGNvZGVAbnVsbGNvZGUuY29t
    www.hidemyemail.net
     
    Nullcode, Nov 25, 2004
    #15
  16. Toby Inkster

    Nullcode Guest

    Jukka K. Korpela wrote:

    > "Michael Winter" <> wrote:
    >
    >
    >> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><title//.
    >>
    >>which is 55 bytes is the smallest possible.

    >
    >
    > Somewhat debatably, no. If you replace PUBLIC with SYSTEM and the quoted
    > string with a quoted URL that points to the HTML 2.0 DTD, you get a
    > shorter document if you can get a short enough URL. I have no
    > sufficiently short URL right now at my disposal, but the following is a
    > proof of concept:
    >
    > <!DOCTYPE HTML SYSTEM
    > "http://www.w3.org/MarkUp/html-spec/html-1.dtd"><title//.
    >
    > So if you replace the quoted string by an absolute URL that redirects to
    > the same address, or points to a copy of the DTD, you should get below 55
    > bytes. I wonder if some http://x.xx (where x's are letters) would be
    > available for this important purpose.
    >
    > It would still be a conforming HTML 2.0 document, since HTML 2.0 requires
    > conformance to the HTML 2.0 DTD, not the use of a particular DOCTYPE
    > declaration (or any DOCTYPE declaration for that matter - but the
    > assignment said the validator should accept the document by its default
    > rules).
    >


    Assuming ftp is valid as a src, that will shave off another byte. Also
    if the file extension doesnt have to be "dtd" you could shave off
    another 2 or possibly 3 if a file extension is admitted[and allowed heh]

    <!DOCTYPE HTML SYSTEM "ftp://x.tk/y.dtd"><title//. 50bytes
    <!DOCTYPE HTML SYSTEM "ftp://x.tk/y"><title//. 46bytes

    --
    Nullcode
    "Suffering is a result of desire"
    bnVsbGNvZGVAbnVsbGNvZGUuY29t
    www.hidemyemail.net
     
    Nullcode, Nov 25, 2004
    #16
  17. Toby Inkster

    Nullcode Guest

    Jukka K. Korpela wrote:

    > "Michael Winter" <> wrote:
    >
    >
    >> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><title//.
    >>
    >>which is 55 bytes is the smallest possible.

    >
    >
    > Somewhat debatably, no. If you replace PUBLIC with SYSTEM and the quoted
    > string with a quoted URL that points to the HTML 2.0 DTD, you get a
    > shorter document if you can get a short enough URL. I have no
    > sufficiently short URL right now at my disposal, but the following is a
    > proof of concept:
    >
    > <!DOCTYPE HTML SYSTEM
    > "http://www.w3.org/MarkUp/html-spec/html-1.dtd"><title//.
    >
    > So if you replace the quoted string by an absolute URL that redirects to
    > the same address, or points to a copy of the DTD, you should get below 55
    > bytes. I wonder if some http://x.xx (where x's are letters) would be
    > available for this important purpose.
    >
    > It would still be a conforming HTML 2.0 document, since HTML 2.0 requires
    > conformance to the HTML 2.0 DTD, not the use of a particular DOCTYPE
    > declaration (or any DOCTYPE declaration for that matter - but the
    > assignment said the validator should accept the document by its default
    > rules).
    >


    If ftp is valid as a src you could shave off a byte. Also possibly
    another 4 if a file extention isnt needed.

    <!DOCTYPE HTML SYSTEM "ftp://x.tk/y.dtd"><title//. 50bytes
    <!DOCTYPE HTML SYSTEM "ftp://x.tk/y"><title//. 46bytes

    Just some thoughts, im by no means someone who has a clue ;)

    --
    Nullcode
    "Suffering is a result of desire"
    bnVsbGNvZGVAbnVsbGNvZGUuY29t
    www.hidemyemail.net
     
    Nullcode, Nov 25, 2004
    #17
  18. Toby Inkster

    Toby Inkster Guest

    Nullcode wrote:

    > Assuming ftp is valid as a src, that will shave off another byte.
    >
    > <!DOCTYPE HTML SYSTEM "ftp://x.tk/y.dtd"><title//. 50bytes
    > <!DOCTYPE HTML SYSTEM "ftp://x.tk/y"><title//. 46bytes


    With URNs you can go smaller.

    <!DOCTYPE HTML SYSTEM "urn:x"><title//.

    But I don't think the W3C validator understands either of those URI
    schemes.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
     
    Toby Inkster, Nov 25, 2004
    #18
  19. Nullcode <null@code> wrote:

    > Assuming ftp is valid as a src,


    I haven't checked what the validator thinks about ftp URLs there, but...

    > <!DOCTYPE HTML SYSTEM "ftp://x.tk/y"><title//. 46bytes


    .... if you can control x.tk or equivalent, you can make the HTTP server
    return a DTD in response to the request http://x.tk which is a byte shorter
    than yours. I don't think you can make the same ("default the filename" to
    speak loosely) with ftp URLs.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
     
    Jukka K. Korpela, Nov 25, 2004
    #19
  20. Toby Inkster

    Mimic Guest

    Jukka K. Korpela wrote:

    > Nullcode <null@code> wrote:
    >
    >
    >>Assuming ftp is valid as a src,

    >
    >
    > I haven't checked what the validator thinks about ftp URLs there, but...
    >
    >
    >><!DOCTYPE HTML SYSTEM "ftp://x.tk/y"><title//. 46bytes

    >
    >
    > ... if you can control x.tk or equivalent, you can make the HTTP server
    > return a DTD in response to the request http://x.tk which is a byte shorter
    > than yours. I don't think you can make the same ("default the filename" to
    > speak loosely) with ftp URLs.
    >


    :D yeah i imagine you could, providing the validator doesnt need to see
    the extension, or you coudl even mod the server config :p

    --
    Mimic

    "In order to step out of the box, you must first be in the box."
    "The voices have stopped now. But they had some good ideas."
    "Pain is free and there to be enjoyed."
    ZGF0YWZsZXhAY2FubmFiaXNtYWlsLmNvbQ== [ www.hidemyemail.net ]
     
    Mimic, Nov 26, 2004
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ken Barrett
    Replies:
    5
    Views:
    807
  2. Guadala Harry

    Minimal Shopping Cart

    Guadala Harry, Sep 27, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    560
    =?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN
    Sep 27, 2004
  3. Rolf
    Replies:
    2
    Views:
    362
    Steve C. Orr [MVP, MCSD]
    Feb 7, 2005
  4. Krick
    Replies:
    5
    Views:
    2,177
    Robert Olofsson
    Aug 13, 2003
  5. KiwiBrian

    Excel to clean and minimal html

    KiwiBrian, Aug 24, 2008, in forum: HTML
    Replies:
    7
    Views:
    794
    dorayme
    Aug 24, 2008
Loading...

Share This Page