Click to See Complete Forum and Search --> : How can I propperly link large portions of html?


Wart_Hog
01-13-2005, 04:05 AM
Hi,

Here's the html I'm using:


<div class="member_box_position">
<a class="member" href="#">
<div>
<img src="" width="" height="" alt="" />
<h2>Heading</h2>
<ul>
<li>Info</li>
<li>Info</li>
</ul>
</div>
</a>
</div>


I would like the entire second <div> to be clickable. This bit of code functions perfectly in most browsers (so far), but it will not pass w3c validation. If anyone knows why this is "wrong", please fill me in. Note: I tried to validate as HTML 4.0 transitional & XHTML transitional. Thank you...


ps. what is a widget??? they're written about EVERYWHERE but these widget authors always fail to include pictures.
If you:

Have ever seen a widget,
Have access to a picture of a widget,
Or personaly know a widget,

...I NEED to know.

pj59
01-13-2005, 05:05 AM
Hello!

Concerning the validation, just give them what they want. Example:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body>
<div class="member_box_position">
<a class="member" href="blah.htm" onclick="alert('لل');">
<object><div style="width: 150px;cursor:pointer">
<img src="" width="" height="" alt="">
<h2>Heading</h2>
<ul>
<li>Info</li>
<li>Info</li>
</ul>
</div></object>
</a>
</div>
</body>
</html>The "mistake" is, that you placed a block level element into an inline level element. That will not validate. The above code will work and validate.

Regards PJ

PeOfEo
01-13-2005, 06:51 AM
A widget is not a physical thing. A widget is an arbitrary good used when talking about economics. For example "a company produces 800 widgets a day and sells them for 2 grand each. If the demand for widgets is at ...").


pj: I am confused about the link, wouldn't you want to be using display:block;?

Wart_Hog
01-13-2005, 07:46 AM
pj: Thanks for the help, it got me the validation that I was
looking for. If I understand this correctly, the following is true.
I was trying to place block level elements (headings and lists) inside of an inline level element (a).

pe: Thanks for the widget info. I think that I'll be able to sleep at night now that the mystery of the widget has finally been solved.

pj59
01-13-2005, 07:57 AM
Originally posted by Wart_Hog
pj: Thanks for the help, it got me the validation that I was
looking for. If I understand this correctly, the following is true.
I was trying to place block level elements (headings and lists) inside of an inline level element (a).Yes, you got it. :D But the complaint you received when trying to validate your code was not because of the headings and lists but because of the div (because this was the first block level element following your anchor tag).

Good luck! PJ

rsd
01-14-2005, 04:33 PM
Widgets are something typically used durring Snipe hunting.