Re: HTML DTD

At 12:06 PM -0400 7/14/00, Adrien Zamani wrote:

>We are using the Validator to validate our Html files.
>we would  like to specify every time we use an image Tag
>(<img ....> or <input type=image ...>) the height and the width
>of the image. That allows the browser to download images faster.
>So how I can do to REQUIRE the width and the height for the tag INPUT
>when the type is IMAGE  :

It is easy to edit an HTML DTD to require height and width on IMG 
elements. For example, see lines 439-440 of 
<http://style.metrius.com/accounts/metrius_house/metrius_transitional. 
dtd>.

I don't know of any DTD-based way to *require* height and width on 
INPUT elements only when the type attribute value is "image" (an 
invalid value in W3C HTML). You probably wouldn't want to have height 
and width on all INPUTs, right? It is, however, possible to *permit* 
height, width, and the image type attribute on INPUT. See lines 671 
and following of the DTD referenced above.

Note: the only reason I can see that you might "need" to muck about 
with image inputs is to accommodate Netscape 4.x users, or rather, 
the page designers who use Netscape 4.x as a visual reference, and 
can't tolerate the user-familiar look of browser-rendered inputs. 
HTML 4 form elements (e.g., <button...><img...></button>) make this 
hack superfluous. Before investing too much effort into 
institutionalizing these sorts of workarounds, consider that if 
current trends continue, NS4.x use will approach 0% in about a year: 
<http://statmarket.com/SM?c=stat062600>. Good riddance to 4.x, and 
long live more conformant UAs!
--
Todd Fahrner
Web UI Technologist
Metrius

Received on Friday, 14 July 2000 14:28:22 UTC