[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: use id="xx" instead of <a name="xx"> in html output

From: Gavin Smith
Subject: Re: use id="xx" instead of <a name="xx"> in html output
Date: Tue, 9 Feb 2016 18:30:35 +0000

On 9 February 2016 at 16:29, Per Bothner <address@hidden> wrote:

>> Another problem is whether this use of "id" is valid for the version
>> of HTML we target: the files are declared as "HTML 4.01 Transitional",
>> but I read that this use of the "id" tag was only introduced in HTML5?
> "id" is in HTML 4.01:
> https://www.w3.org/TR/html4/struct/global.html#adef-id

Looks like it should be OK then. Any other opinions?

I think <A NAME> is good to use for the target of a hyperlink, even if
it has been deprecated by HTML5, this was always the way to do it in
earlier versions of HTML. The reason to use the the ID attribute would
be for manipulation with JavaScript functions like getElementById.

>> I see no need for a two levels of <div>. "Nodes" are an artifact of
>> the Texinfo source. They don't have an idiomatic meaning in HTML. In
>> the Info format, they define the target of a cross-reference and also
>> define a sub-unit of the Info file.
> A node does have a meaning in HTML: It is the part of a chapter/section/
> whatever that is not a child chapter/section/whatever.  As such it is
> useful if you want to simulate --split=node after-the-fact.  Specifically,
> you may want to hide everything except the current node.
> In CSS:
> div[current="false"} { display: hide }
> and then you use JavaScript to set the "current attribute to "false"
> on all nodes except the current one.
>> The idiomatic way to show a chapter structure in an HTML file is with
>> the heading commands <h1>, <h2>, <h3> etc. No need to wrap each
>> section in two layers of <div>s.
>> ...
>> Something like:
>>> <h2>Chapter1</h2>
>>> Preamble
>>> <h3>Section11</h3>
>>> section11-text
>>> <h3>Section12</h3>
>>> section12-text
>> is more idiomatic HTML.
> This would imply the wrong structure, since the "header" for a chapter
> comes *before* the h2.

I see: you mean the header with the Next:, Prev:, Up:, links? You are
right, then. If you want to manipulate the document with JavaScript,
making nodes pop in to and out of existence, maybe with menus of
subnodes sliding around as well, then you would need the entire node
in one element.

This is assuming an entire manual in a single HTML file - JavaScript
to process a manual with one page per node would have different needs,
of course.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]