1

I have created a button, as shown below. Now I am working on linking it. However the href part seems to be out of order. Does anyone know how to link the button to a site (use https://aol.com). Thank you

<body>
    <div class="result15823794" style="width: 160px; height: 30px;     background-image:     url(&quot;http://static1.grsites.com/user/generate/items/button84799376.png&quot    ;);
    " onmouseover="this.style.backgroundImage =     'url(http://static1.grsites.com/user/generate/items/button76804217.png)'
    " onmouseout="this.style.backgroundImage =     'url(http://static1.grsites.com/user/generate/items/button84799376.png)'">
    <div style="background-image:     url(http://static1.grsites.com/images/0.gif); 
    width: 160px; height: 30px;"></div>
    </div>
</body>
Forma
  • 13
  • 5

3 Answers3

1

onclick="location.href='https://aol.com/';"

Sample:

<body>
  <div onclick="location.href='https://aol.com/';" class="result15823794" style="width: 160px; height: 30px;     background-image:     url(&quot;http://static1.grsites.com/user/generate/items/button84799376.png&quot    ;);
        " onmouseover="this.style.backgroundImage =     'url(http://static1.grsites.com/user/generate/items/button76804217.png)'
        " onmouseout="this.style.backgroundImage =     'url(http://static1.grsites.com/user/generate/items/button84799376.png)'" onclick="location.href='https://aol.com/';">
    <div style="background-image:     url(http://static1.grsites.com/images/0.gif); 
        width: 160px; height: 30px;"></div>
  </div>
</body>
Chris Happy
  • 7,088
  • 2
  • 22
  • 49
0

you can wrap the outmost div with an anchor containing the href to AOL like this:

<a href="https://aol.com/"><div class="result15823794" style="width: 160px; height: 30px;     background-image:     url(&quot;http://static1.grsites.com/user/generate/items/button84799376.png&quot    ;);
    " onmouseover="this.style.backgroundImage =     'url(http://static1.grsites.com/user/generate/items/button76804217.png)'
    " onmouseout="this.style.backgroundImage =     'url(http://static1.grsites.com/user/generate/items/button84799376.png)'">
    <div style="background-image:     url(http://static1.grsites.com/images/0.gif); 
    width: 160px; height: 30px;"></div>
    </div></a>
nineusa
  • 1
  • 1
0
<a href="https://aol.com" target="_blank">

add this after the body the <body> tag, then add the closing of the anchor tag before the closing </body> tag. Just like my code below.

<body>
    <a href="https://aol.com" target="_blank">
    <div class="result15823794" style="width: 160px; height: 30px;     background-image:     url(&quot;http://static1.grsites.com/user/generate/items/button84799376.png&quot    ;);
    " onmouseover="this.style.backgroundImage =     'url(http://static1.grsites.com/user/generate/items/button76804217.png)'
    " onmouseout="this.style.backgroundImage =     'url(http://static1.grsites.com/user/generate/items/button84799376.png)'">
    <div style="background-image:     url(http://static1.grsites.com/images/0.gif); 
    width: 160px; height: 30px;"></div>
    </div>
    </a>
</body>