W3C home > Mailing lists > Public > www-html@w3.org > August 2002

Re: XHTML 2.0 and the href and src attributes

From: Jonny Axelsson <jax@opera.no>
Date: Thu, 08 Aug 2002 17:00:26 +0200
To: www-html@w3.org
Message-Id: <2UVSZWECKG1UPNJG2YZY652ZWSNHZ5.3d52878a@falcon>

08.08.02 16:32:36, Chris Mannall <chris.mannall@hecubagames.com> wrote:

>The issue I have is solely limited to src and href, which have no 
>semantic difference whatsoever. If there was a consistent difference 
>between the two, such as 'src' always referring to resources to be 
>embedded within the page (e.g. scripts, stylesheets) and href always 
>referring to resources that are *pointed at* rather than included (e.g. 
>anchors), then I could understand why two attributes are necessary. 

There is such a difference in general (e.g. in the XHTML 1.0 Image module), 
though in the case of script and style, this is arguably inconsistent. 
Styles are linked using the link element (or by the xml-stylesheet PI), 
while scripts are linked using the src attribute.



>As a somewhat related aside, why is the Hypertext attribute collection 
>used so liberally? What is the intended meaning of e.g.:
>
>     <em href="http://www.example.com/">
>        this,
>     </em>

For most purposes equivalent to:
<em><a href="http://www.example.com/">this,</a></em>


>     <div href="http://www.example.com/">
>        this,
>     </div>

For most purposes equivalent to:
<div><a href="http://www.example.com/">this,</a></div>


>     <body href="http://www.example.com/">
>        and, strangest of all, this?
>     </body>

For most purposes equivalent to:
<body>
<a href="http://www.example.com/">and, strangest of all, this?</a>
</body>


This means that every element is a potential link, this includes block 
elements. More daringly, the restriction on nesting "a href"-type links is 
gone. You can have:

<p href="http://www.example.net/there">
Do you want to go there or 
  <span href="http://www.example.net/elsewhere">somewhere else</span>
?
</p>

Inside the span you go to .../elsewhere, outside the span, but inside the p 
you go to .../there.


> If so, surely this would make the 'a' element somewhat redundant?

It would make the a element entirely redundant. 



Jonny Axelsson
Documentation,
Opera software
Received on Thursday, 8 August 2002 10:56:30 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:15:52 GMT