views:

47

answers:

2

I am bad in html layout but I have to produce it :) I want to make big button on a page that is implemented as complex html layout with children tags (maybe - a bad idea). I can handle click event on boundary element with javascript but it requires javascript enabled. I can wrap boundary element with "anchor" tag but is doesn't work in IE

Please, suggest me the best way to implement this.

<a href="...">        
        <table>
            <td>                                
                ...
            </td>
            <td>
                ...
                   <table> ... </table>
            </td>       
        </table>

    </a>
A: 

How about placing all of your content, then using css to absolutely position a giant <a> tag on top of it? The anchor wouldn't need child element's, they would be siblings. The absolute positioning makes the whole area clickable. But make sure the <a> is on top of the z order.

Tesserex
Anchor tags are not block elements, so they won't "cover" anything.
Robusto
I tried this advise, assigned "display:inline-block" to anchor tag and made it the same size as area it covers, but once again IE places anchor tag differently compared to FireFox :( I suppose if I'll spend some more time on it, I'll make layout crossbrowser but may be there are better approaches?
Andrew Florko
A: 

How about some simple JavaScript?

<div style="cursor:pointer;" onClick="javascript:document.location.href='...'><table>...</table></div>
Matthew Smith
Thank you Matthew, but it requires enabled javascript. I have to do something like that right now but wonder if I can live without javascript
Andrew Florko