W3C home > Mailing lists > Public > www-html@w3.org > July 2004

href attribute

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Sun, 4 Jul 2004 17:42:50 -0700
Message-ID: <003601c46229$000befe0$0401a8c0@ATHLON>
To: <www-html@w3.org>

Question is:

Is there any logical problems to allow any HTML element to have href
attribute thus behave as a hyperlink?

As far as I can see any element in HTML having ID attribute set can behave
as an anchor - be a hyperlink destination point - addressable fragment. So
why any element cannot behave as a hyperlink then?
...keeping in mind that CSS is ready for that - any element can have
pseudo-classes: :hover, :active, :link, etc. set.

Let's consider implementation of menu on web page as:
<ul>
  <li href="/item1.php">menu item #1</li>
  <li href="/item2.php">menu item #2</li>
  <li href="/item3.php">menu item #3</li>
</ul>

If <LI> has some rectangular style applied (with background and borders) it
is better to declare
this LI in the whole as a hypelink sensitive area rather than its textual
part like <a>menu item #1</a>.

Solution currently heavily used for this is to apply CSS's display:block for
the A attribute like:

a { display:block; background:...; border:...}
<ul>
  <li><a href="/item1.php">menu item #1</a></li>
</ul>
But this approach is a bit artificial/unnatural and creates some problems if
e.g. text is multiline and desired box size of the menu item is
significantly bigger than text size.

Does anybody know any previous discussions about this?

Andrew Fedoniouk.
http://terrainformatica.com
Received on Sunday, 4 July 2004 20:43:13 GMT

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