[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: |
Per Bothner |
Subject: |
Re: use id="xx" instead of <a name="xx"> in html output |
Date: |
Thu, 11 Feb 2016 23:48:44 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 |
On 02/11/2016 11:30 PM, Gavin Smith wrote:
On 9 February 2016 at 20:07, Per Bothner <address@hidden> wrote:
If we defer adding the <div>s for node until we see they needed (which may
make sense), then we get:
<section class="chapter" id="Chapter1">
<header>LINKS for chapter1</header>
<h2>Chapter1</h2>
Preamble
<table class="menu">...</table>
<section class="section" id="section11">
<header>LINKS for section11</header>
<h3>Section11</h3>
section11-text
</section>
<section class="section" id="section12">
<header>LINKS for section12</header>
<h3>Section12</h3>
section12-text
</section>
</section>
I agree in principle. This would have to be optional (because
<section> is an HTML5 tag),
Browsers generally ignore tags they don't understand, so I believe
there is no harm in using <section> instead of <div>, even for older
browsers. However, this would need to be tested.
OTOH, if there is concern, there isn't really
much difference between:
<section class="chapter" id="Chapter1">
and
<div class="chapter" id="Chapter1">
The former is slightly more readable and explicit,
but in practice the difference is minor. Especially if
you add a stylesheet rule:
section { display: block }
--
--Per Bothner
address@hidden http://per.bothner.com/