Button link not working in IE7

Ok I’ve got the following code so when a button is clicked on it takes the user to another page:

<a href="link.html">
<button type="button" title="Click here" class="button btn-general"><span>Click Here</span></button>
</a>

This doesn’t seem to work in IE7 at all, can anyway explain the best way of doing this?

Cheers :slight_smile:

For anyone else assuming the button was used because the W3C states it’s very style-able AND can do anything with scripts, know that Javascript can interact with an anchor and can talk to the server if necessary.

I agree with Paul’s first suggestion. I would recommend yanking the button control and you may be able to ditch the span element too unless you need it.

Then use something like this

a.button {
background: url(…/path/to/Images/button.jpg) no-repeat;
position: absolute;
width: 200px;
height: 100px;
left: 0;
}

Hi,

I would say use an anchor styled as a button would be the suitable way to do it.:slight_smile:

IE wont allow the control and the anchor to work and you’d need to do it via submit.


<form method="get" [B]action="http://www.google.co.uk/">[/B]
    <div>
        <button [B]type="submit[/B]" id="click" title="Click here" class="button btn-general"><span>Click Here</span></button>
    </div>
</form>