On 12/5/07, Jesper Rønn-Jensen <[EMAIL PROTECTED]> wrote:
> I'm creating a small "appetizer" section on a web page. You probably know it
> from news websites or web2.0-like signup graphics:
>
> I need a combination of an image, headline, paragraph text and a link all to
> be clickable. All of this nested in a div, that changes background-color on
> hover and is clickable. So instead of adding an a-element to each inline
> text/image, I want the empty space in the div to be clickable too.
>
> Here is the markup I imagine:
> div (wrapper div -- probably with rounded corners)
>   h3 (heading)
>   img (image for this article -- could go inside h3 if that would be better)
>   p (appetizer text)
>   p > a (read more)
>
> What's the most ideal way of doing this?
>
> Here are the different strategies I can come up with -- but what would be
> the most ideal. Criteria:
> * accessible
> * slim markup
> * easy to implement and maintain
> * not necessarily cross-browser compatible, as long as the fallback works
> (but must work as intended in IE7 and FF2)
> * must validate xhtml (1.0 transitional)
>
You want a single hyperlink on one line of text (avoiding too many
links to the same resource is an accessibility guideline). Odds are
that the most suitable bit of text will be the heading, since it will
indicate what the article is about. "Read more" is semantically
useless, and as bad as "click here" - it works for the sighted user
with a visual browser, but for people (and searchbots) where all
navigation is performed via a listing of links on the page without any
other context, its hopeless.
You can do your hover effects with css on an outer element (with a
little bit of help for IE7) and use a javascript onclick handler to
link the other elements. (I think you can get away with just the outer
container, but I haven't tried it myself).

-- 
Richard Grevers, New Plymouth, New Zealand
Dramatic Design www.dramatic.co.nz
______________________________________________________________________
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/

Reply via email to