What's wrong with this HTML (fails validation) ?

  • Thread starter robert maas, see http://tinyurl.com/uh3t
  • Start date
A

Andy Dingley

Which of those is appropriate for running text that leads into a UL element?

Depends on what you mean by "running text".

If this is what I'd think of as "running text", then it shouldn't
have any specifc markup around it at all. After all, it's just
"running text", purely the content of the text block and running right
into what I presume is an inlined list.

<div>Omnia Gallia in tres partes divisa est <ul>
<li>singulî</ul>
<li>secundus</ul>
<li>tertius</ul>
</ul>
</div>

Note two things about this:

* You need to set the list (ul and li) to display: inline; with CSS.

* It's a <div>, not a <p>. This is because HTML doesn't allow <p> to
contain other block elements (like a list). Although CSS permits an
inline list to be rendered, HTML doesn't really support the concept
natively. HTML lists are block elements.


If you mean "A heading that runs into a UL element without any
linebreak", then mark it up with <h2> etc. just as you'd expect. Then
use CSS and display:inline; to run things together, as needed.

Note that these two cases are semantically different, depending on
what you intend this "running text" to represent. CSS lets them both
be presented identically, but there is a conceptual difference between
them and you ought to preserve this.
 
R

robert maas, see http://tinyurl.com/uh3t

From: "Beauregard T. Shagnasty said:
Isn't is funny what one simple error can do? <lol!>
.. ReSpam2002Jan08</a\>.

Oops, fixed now. Thank you very much for spotting that typo and
bringing it to my attention. I have no idea how that extra
character could have gotten in there, because the \ key is nowhere
near either the previous or following character on the keyboard.

By the way, I'm curious: Which Web browser were you using that got
tricked by that typo? Lynx here is apparently sloppy enough that I
didn't notice it myself. I usually notice non-completed anchors
because they show as a huge chunk of BOLD text in lynx, but not in
this case.

I wonder how long ago I made that mistake, and nobody before you
had the kindness to tell me about it? Months is my guess, sigh.
There are disadvantages to being a high-volume site, that one tiny
mistake and your phone line is flooded with complaints, but this is
a case of a disadvantage to being a low-volume site, nobody
noticing a mistake for a very very long time.

I ran the validator over the file now, found two cases where I had
a bare ampersand character within a quoted string. Honestly I
didn't know that was not allowed. I thought you could put anything
in a quoted string, even ampersands. Oh well, learn something new
every day... So I fixed those two.

That left only one validation error:
1. Error Line 57 column 23: character "?" not allowed in end tag.
username <em>guest1</em?>, password <em>free</em>.<br />

Oops! And that *does* have a ready explanation as a keyboard typo,
since the ? key is right next to the > key so I probably bumped the
? key on the way to reach for the > key and failed to notice it.
Fixing that now ... done:
Result: Passed validation
Address: http://www.rawbw.com/~rem/WAP/ContactMe.html
Phew! (sound of relief)

Thanks a second time, this time for alerting me to that file in
general so I'd try the validator and find the three other errors
that had also crept in.

And thanks to whoever told me about the validator for the very
first time a year or so ago.

<TMI>A few days ago I decided that the validators were sufficiently
urgent for my current project that I set up links to them from my
local home page, so now instead of spending five minutes looking
for where I put the URLs, I just start a new instance of lynx and
follow the links to the validators lickedy split.</TMI>

I'm sure glad I'm working on innocent CGI applications and Web
pages, not on military software for missile control systems. I'd
hate to have to say "Oops" after a teensy little typo caused an
unauthorized launch, with faulty targeting too, causing (for
example) Paris and adjoining region to be vaporized.
 
D

Dan

Fixing that now ... done:
Result: Passed validation
Address:http://www.rawbw.com/~rem/WAP/ContactMe.html

Valid... but still not *correct*. The code in question still contains
bogus XHTML-isms like <BR />, despite all the explanations you have
received on this newsgroup of how this is not proper in a document
that is headed by an HTML doctype (instead of XHTML), as well as the
bogus-in-both-HTML-and-XHTML <P />, which seems to stem from your
mistakenly regarding <P> as an empty paragraph break tag instead of a
container element intended to contain a paragraph; your interpretation
became obsolete with the release of HTML 2.0 in 1994.
 
B

Blinky the Shark

robert said:
Oops, fixed now. Thank you very much for spotting that typo and
bringing it to my attention. I have no idea how that extra
character could have gotten in there, because the \ key is nowhere
near either the previous or following character on the keyboard.

By the way, I'm curious: Which Web browser were you using that got
tricked by that typo? Lynx here is apparently sloppy enough that I

I discovered it and I was using Firefox.
 
R

robert maas, see http://tinyurl.com/uh3t

From: Blinky the Shark said:
I think it works quite well with "carpenter" and "hand tools".

I agree. In fact I already have "hand tools" for computer software development:
- Computer with VT100 emulator and local text editor and HyperCard
for organizing local information for convenient retrieval.
- Dialup shell account on FreeBSD Unix which has several different
programming languages (CMU Common Lisp, perl, PHP, C, C++, Java)
which I can use for writing software remotely over dialup.
- Web service on the ISP, whereby I can publish access to my
software on a trial basis via CGI, to allow evaluation of my
implementation of algorithms, without disclosing the source code
nor even the object code to criminals who wish to steal my
efforts and market as if their own work.
If there's something else you consider at the "hand tools" level
for individual work developing small software applications, please
present your case.

In fact a few of the applications I've developed on FreeBSD Unix
aren't small at all, such as my system for dealing with spam,
automatically intercepting incoming e-mail, parsing headers,
diagosing blacklisted ISPs whose e-mail is spam beyond reasoable
doubt, collecting WHOIS records and gleaning them for mention of
spam-complaint address, trying such gleaned addresses to make sure
they really work, installing such verified spam-complaint addresses
in database, running traceroute to discover upstream ISPs and
performing the same kind of WHOIS/glean/verify/DB process on them
likewise, deciding which spam-complaint address to use for this
spam that just now arrived, composing spam complaint, sending it,
keeping track of which spam messages have already been complained
about, keeping statistics of spam-generating ISPs to guide future
filtering.
I don't think contractors supply carpenters with hammers and
screwdrivers.

And likewise I do all this software development, for free, on my
own initiative, using my own tools (computer I purchased using my
own money, dialup shell account I pay for out of my own money), to
demonstrate my continued ability to produce novel software
application. And if somebody decided to hire me to write software
for them, I'd be glad to perform such development on my dialup
shell account at my own expense, and demonstrate it for the
customer via CGI, and then deliver source code to the customer
*after* I receive payment for my work. I don't require the customer
to provide me with additional tools such as a different shell
account or a new computer etc. before I start work for them.
I only require a contract for services.
And I think that what he's lacking, in terms of hardware and
connectivity, really are the basic tools (IE sophisticated?
Firefix costly? <g>), not the power tools.

It would cost me at least $500 that I can't afford to purchase a
new computer capable of running those "basic tools", and I fail to
see how they would be of any value in increasing my productivity at
writing new software applications. You need to present your case,
not just flash unproven claims as if true.
And as for "carpenter" instead of "contractor", he *has* said
that he just wants to be the laborer.

Yes. I'm quite capable of helping with the system design
brainstorming, conceiving new algorithms and software organization
to satisfy the use cases, and then writing most/all of the software
to implement those algorithms per that organization. But I don't
claim to have the skills necessary to manage a large multi-person
software project, nor to handle the larger matters of a
profit-making company which are outside the scope of software
design and implementation. I'd be quite content to develop a
medium-sized black-box module with a clean interface to fit into a
larger project that is otherwise written by others. Per the
metaphor, I could handcraft and install all the windows and
bookcases and cupboards and pantries and counters, and I could also
handle the electrical and network wiring, but the contractor would
have to find others to build the walls and cement floors/walkways
and plumbing.

And if I volunteer on the side, for **free**, to set up a simple
Web site that allows the various workers to communicate with each
other and with the contractor to discuss progress and problems, to
avoid the hassle of stopping all work get everyone together into a
face-to-face verbal meeting, the don't fucking complain that my
simple text-only Web site doesn't have pretty pictures flashing all
over the screen. If you want a fancy Web site, you pay somebody
**money** for it. If you take my Web labor for free, you get more
than you pay for, but not as much as you greedily expect for free.
I'm fed up with people who refuse to pay me even one penny for my work,
but the complain my free labor isn't up to the highest paid-work standards.
 
B

Blinky the Shark

robert said:

Great. But excuse me if I mention that I've kinda lost my train of
thought and my interest in the thread since I posted the above three
weeks ago. :)

<snip>
 
R

robert maas, see http://tinyurl.com/uh3t

From: John Hosking said:
some poor saps in Africa have lots worse connectivity and have to
make do as best they can.

Do you honestly consider sending out a billion Nigerian 419 spam
per hour "make do as best they can". They have shit better net
connecivity than I have, but they squander such connectivity with
gross abuse instead of the decent kinds of things I do.

Oh, you're talking about the vast majority of Africans who don't
even have a roof over their head nor electricity nor potable water
much less a **COMPUTER**, not even one shared computer per village?
Nevermind.
I do suggest you not worry about vertical spacing in various
browsers until you are in a position to try them out and compare
results.

In fact I got very brief access to Mozilla and IE last week, and
looked quickly at part of my CookTop and Matrix, and was horrified
to see how badly they did, putting blank lines in all sorts of
unwanted places. Unfortunately my access there is too limited to
allow me to try various things to remedy the not-what-the-doctor-ordered
rendering.
Using <code>.

I tried that. It doesn't work. Instead of:
begin
n=5;
m=3*n;
print m;
end
I got begin n=5; m=3*n; print m; end, which is not at all what I want.
<p>Now once you... So suppose you enter two numbers, with a space
between them, such as... <code>42 69 </code>on a single line of input?
...right now.</p>

I tried that. It doesn't work.
I can style the <code> element with whatever font, and as a
block, with some spacing fore and aft

Maybe you can do that, but I can't, so your comment is irrelevant.
if you're trying for any semantic correctness, is to mark your
paragraphs as <p>.

Please take another look at both CookTop and Matrix and let me know
if you see anything like that currently.
Within the <p> elements then, mark up some <code> (as Jonathan
explained), or use <div> elements (as Jukka suggested), or use
<pre> and style it for those who can appreciate such things.

Block-level tags are not allowed inside paragraphs.
And even if I could add styling to <pre>, there'd be no way for me
to see what I'm doing, so it'd come out crap for absolute sure.
Of course if you are willing to be eyes-for-the-blind, I could do
it blind and listen to your description of how it looks. Would you
be willing to join me on IRC sometime soon to work like that?
I edit a change, then IRC tell you I did it, then you look at it and
IRC tell me how it looks, lather rinse repeat.
Are you willing to spend the time helping me like that?
 
R

robert maas, see http://tinyurl.com/uh3t

From: "Andy Dingley said:
Depends on what you mean by "running text".
If this is what I'd think of as "running text", then it shouldn't
have any specifc markup around it at all. After all, it's just
"running text", purely the content of the text block and running right
into what I presume is an inlined list.
<div>Omnia Gallia in tres partes divisa est <ul>
<li>singul=EE</ul>
<li>secundus</ul>
<li>tertius</ul>
</ul>
</div>

Ah, indeed that's what I already did after you posted your article
but before I had time to read it and respond, except I have a
single <div>...........</div> surrounding a whole batch of
text<ul>...</ul> units. I don't know if it'll have the right
effect, haven't looked at it at all after doing it, will take a
look now in lynx, no way to view it in IE or Mozilla, anyway here
goes my first lynx-look since the big edit ... I got tired halfway
through CookTop, but it looked fine to that point. I found several
typos in Matrix, causing my interest to be maintained long enough
to lightly proofread all the way to the end. I found only one place
(*) where paragraph-breakage was wrong, and fixed it.

* (except for every fucking <pre>...</pre> which looks sucky now)

So how does it look to you in those other Web browsers you but not
I have access to?
* You need to set the list (ul and li) to display: inline; with CSS.

I have no way to see what it looks like, hence no feedback whether
I'm doing the right thing or not. Will you agree to get on an IRC
channel with me, and give me live feedback, as I perform a batch of
edits like that?
* It's a <div>, not a <p>. This is because HTML doesn't allow <p>
to contain other block elements (like a list).

Yes, I was aware of that. The documentation for div seemed to
indicate that you aren't supposed to use it except when you want to
apply special formatting/style to such a portion of a document.
You're not supposed to just use it to fake inline text passing
validation. But there's really nothing else suitable, so a week or
so ago I decided to use div anyway. So what I already did and what
you recommend seem to agree.
If you mean "A heading that runs into a UL element without any
linebreak", then mark it up with <h2> etc. just as you'd expect.

Um, the "heading" is often more than one line of text. It's more
like a preface or introduction than what HTML calls a 'heading'. So
I don't think said:
Then use CSS and display:inline; to run things together, as
needed.

Again, unless you are willing to spend time on IRC giving me live
interactive sight-for-the-blind as I do my edit, there's no point
in your telling me what I ought to do. (Perhaps color blind would
be a better metaphor. In fact in 5th grade my school teacher asked
me to do a favor: Accompany him to the supply room to show him the
various colors of paint needed for the class, because he was color
blind. He can see just fine, just can't see color. I can see text
just fine, but can't see color or font or size or style etc. when
using lynx via VT100 dialup.) In case you didn't see it yet:
Note that these two cases are semantically different, depending on
what you intend this "running text" to represent. CSS lets them both
be presented identically, but there is a conceptual difference between
them and you ought to preserve this.

In the case of unnumbered lists with preface (but no trailer), it's
like a multi-line paragraph-style header, which AFAIK isn't at all
supported by HTML 4.x although earlier versions faked it just fine.
I'm afraid I have no alternative except nicely run on adjacent
lines in lynx but with a one-line gap in Mozilla and IE.

In the case of code examples, it's all one huge logical paragraph,
but with little insets every so often throughout the running text
of the paragraph. The blank lines after each pre in lynx are enough
of a pain, blank lines both before and after in Mozilla and IE are
a double pain that is so bad I'm thinking of indenting instead of
outdenting the code examples. I.e. use <br> to split lines, and
&nbsp;&nbsp; at the start of each line of code to indent it
relative to the main body of the paragraph. I just thought of that
idea after I was already done massively re-editing both CookTop and
Matrix to have proper paragraph and div structure around bodies of
text that do not or do have unnumbered lists within them. Maybe
when I feel like trashing most of that work I did, I might try that
alternate idea. Does it sound good to you?

The way it is right now, I end a paragraph before each pre and
start a new paragraph after the pre, totally breaking the logical
nature of paragraphs. But the<br>
&nbsp;&nbsp;first line of code<br>
&nbsp;&nbsp;second line of code<br>
would retain the logic of one huge paragraph with little sections
of funny stuff *within* that one big paragraph. So does it sound
like a winner, and my previous edit to make you happy last week was
a big mistake that I should undo in favor of my new idea? Or not?

By the way, on another project, I might create Web pages that have
lots of embedded images of Chinese characters, viewable in the
nearby lab where Chinese fonts aren't available.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top