At 03:24 23 12 10, Joseba Roldan wrote:
Hi,
in HTML5 you can nest divs into a <a></a> block, as you can see
here<http://www.w3schools.com/html5/tag_a.asp>and in the next example:
<a href="http://somewhere.com">
<div id="myDiv">
<p>Here is my fancy text</p>
</div>
<div id="anotherDiv">
<p>More fancy text</p>
</div>
</a>
In this example both divs are links.
Some legacy sites are not ready for HTML5 conversion. Then, I'm not
so sure about this method even for new development. Because:
Divs are block-level elements, anchor tags are line-level elements.
Loosening the standards to permit inserting block elements inside
of line elements seems like throwing the standards out with the
bath water. Else, there is a leveling between the two and the
distinction will go away completely... eventually.
OTOH, clickable links are *content* that should be in the foreground.
So what is really wrong with simply inserting the image link inside
of the anchor tag, just like in the old days? Give it an id so that
you can position it independently of other anchor or img elements.
It's clean, concise, doesn't add convoluted markup to the html or
css or add js that might not be supported.
It's for a company logo that will be used for navigation, so:
<div id="branding">
<a href="#" title="Company Name Home Page">
<img src="#" height="x" width="y" alt="Company Name Home Page" />
</a>
</div>
Much easier to read when reading the source code. Drop the self-
closing img tag for HTML 4.01 and earlier.
Reese
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/