You are here: Re: What's wrong with this HTML (fails validation) ? « HTML « IT news, forums, messages
Re: What's wrong with this HTML (fails validation) ?

Posted by robert maas, see http://tinyurl.com/uh3t on 02/18/07 18:56

> From: John Hosking <J...@DELETE.Hosking.name.INVALID>
> > I do have one present worry. With the "loose" DTD (I'm not using the word
> > "transitional" more in discussions about it
> > because it causes too much confusion), it allows the following trick:
> > Text that introduces a list:<ul>
> > <li>First item</li>
> > <li>Second item</li>
> > </ul>
> > The effect is that the text that introduces is immediately adjacent
> > to the first list item, no blank line between them.
> ...in your version of Lynx, presumably because that's what the
> Lynx developers thought would be good behavior in that situation.
> You're lucky you like that behavior. It's surprising behavior (to
> me), though.

How would you *expect* that HTML to render?

> Do you mean the results look like this:
> Text that introduces a list: * First item
> * Second item

No. It looks like this:
Text that introduces a list:
* First item
* Second item

It does *not* look like this:
Text that introduces a list:
(blank line here)
* First item
* Second item

So now that you mention it, what is the correct HTML way to build
an unnumbered list which has an introductory line at the top which
is logically *part* of the unnumbered list but *not* one of the
items in the list? For example how do you create a table of
contents which says "Table of Contents:" before the first chapter
item?

Also, what's the proper HTML way to build a hierarchial table of
contents?

Table of contents:
* Chapter 1: "before the Earth"
- Section: "Synthesis of hadrons"
- Section: "Condensation of plasma"
- Section: "Formation of galaxies"
* Chapter 2: "Earth before life"
- Section: "Formation of Moon"
- Section: "Late Heavy Bombardment"
* Chapter 3: "Life before eukaryotes"
- Section: "First replicators"
- Section: "DNA takeover"
- Section: "Photosynthesis"

How should that *structure* be specified in HTML?
It should render in all browsers vaguely like I drew it above, but
the details don't matter so long as it's obvious from the rendering
what the underlying orgaization is. For example, if it renders like
this:

Table of contents:
* Chapter 1: "before the Earth"

- Section: "Synthesis of hadrons"
- Section: "Condensation of plasma"
- Section: "Formation of galaxies"
* Chapter 2: "Earth before life"

- Section: "Formation of Moon"
- Section: "Late Heavy Bombardment"
* Chapter 3: "Life before eukaryotes"

- Section: "First replicators"
- Section: "DNA takeover"
- Section: "Photosynthesis"

That's grossly wrong because the visual effect is to lump the title
for chapter 2 with the sections for chapter 1, etc., confusing the
user/reader who is trying to figure it all out.

> I think you will find, ... that the W3C has nothing particular to
> say about spacing before or after a UL or OL element, although it
> is a block-level element (like <p>, <pre>, or <hr>).

So it would be perfectly reasonable/allowable if some browser would
render the nested UL/LI/UL/LI structure that horrid way I showed
just above?? So is there any HTML that would specify such a nested
table of contents properly, even if some browsers render it as
garbage, at least it's structurally *correct* per HTML standards?

> > Now at the *end* of a UL element, there's always a blank line, just
> > like with a PRE element, but I never have running text that I want
> > adjacent to the bottom of a UL element,
> It would be strange if you (or anyone) did.

Well I can imagine a perverse case where somebody might want that,
for example somebody might be describing his travails at trying to
write a novel:

First I had four chapters:
* Lady meets guy
* Lady and guy fall in love
* Guy meets another lady
* Guy breaks lady's heart
but then I realized there's a missing step in there, so I
changed it to be like this:
* Lady meets guy
* Lady and guy start dating on regular basis
* Lady and guy fall in love
* Guy meets another lady
* Guy breaks lady's heart
then I thought to enhance the suspense I should leave out one of
the titles and let the reader guess what caused the sad part at
the end:
* Lady meets guy
* Lady and guy start meeting on regular basis
* Lady and guy fall in love
* Guy breaks lady's heart
but then I thought that was unfair. I ought to at least give the
reader a clue as to that surprise event, so now I have:
* Lady meets guy
* Lady and guy start meeting on regular basis
* Lady and guy fall in love
* Heather Thompson - what's she doing in here?
* Guy breaks lady's heart

Now it wouldn't totally break the logic for there to be a blank
line after each listing of chapters, but still it would break up
the flow of the story of the travails a little bit.

But that's moot for my present needs.

> > ... Am I the only
> > person in this entire newsgroup who has access to lynx and has
> > experience matching the HTML with the the way lynx renders it?
> I think, sir, that you are the only person here recently for whom
> Lynx's behavior is a crisis situation.

It's not a crisis, just something that's frustrating me. If it
looks better in other browsers I have no access to, then I'll have
to just live with it, knowing what I see here (slightly messed up)
isn't what most others see (as I intended by the markup).

Maybe if I can get on a full InterNet terminal tomorrow (Monday)
and view it in IE and Mozilla, if it looks fine there, I can stop
fussing over it. (But probably three other things that look fine in
lynx will look totally wrong in IE and/or Mozilla, and I'll be
posting a panic article tomorrow evening. Yeah, I have a
pessimistic kind of personality, as a result of many disasters that
have struck me already, and nothing really good ever happening!)

> There is news:comp.os.lynx

'lynx' as I'm using it is a Web browser (user agent), not an
operating system, so that sounds more like the same word with
totally different meaning, unless the newsgroup name is a misnomer.
I'll take a look now ... yeah, LynxOS seems to be an alternative to
Linux, an operating system, probably in the Unix family too.
Red herring.

> but I don't imagine they're too interested in discussing HTML
> issues there. Lurk there for a while and see.

No, not worth the expense for zero expected benefit.

> > I'm not sure which aspects of the HTML you consider "the publishing
> > part".
> I meant the part where you mark up your text as HTML and post to to the Web.

Well that's necessary right from the beginning. Like I said,
there's no other way for me to check each link as I create it.

> Your public library is better equipped than you are, ...

Yeah. They got some kind of state grant to pay for installing
InterNet terminals. Way back around 1991-92 when I approached my
local public library to show them my toplevel meta-index to the
InterNet, suggesting it might be a useful reference source to
include in their local collection, to help library patrons find
stuff on the InterNet, for example if they wanted to know where
there was a list of all mailing lists or newsgroups or major FTP
archives with specific kinds of software available for download,
the staff at the library said the InterNet is of no value
whatsoever to the library and they refused to allow me to even show
them my indexes. Then a few years later comes $$money$$ with a
mandate to install InterNet terminals, and suddenly their opinion
turns around completely, and promptly they purchase and install
InterNet terminals.

Me, I have no funding for anything, not even food.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация