1

I have created a div in the theme template header php file, the following is the code used:

 <?php if (( is_page('police-check-online') AND ! wp_is_mobile() )) { ?>
 <div style="float:right; width:450px; margin-right:350px; color:white; margin-bottom:-250px; margin-top:120px; z-index:100;">
       <div style="float:left; width:50%;"><h3>fit2work badges</h3></div><div style="float:left; width:50%; z-index:200;"><a href="https://fit2work.com.au/Public/badge" class="badgebtn">PURCHASE NOW</a></div>
           <div style="z-index:300;"><a href="https://fit2work.com.au/Public/badge"><img src="http://mercury.com.au/wp-content/uploads/badges/fit2workbadges_03.png"></a></div></div>

       <?php } ?>

The problem is that the link does not work.

I have tried (as you can see), with playing around with the z-index of the various div's.

Very confused.

As a side note, if I change the code to leave out the closing after the second link element, then it works (albeit everything on the page until the next link element is also linked)

Help, please! I'm absolutely confused.

Live site page is here: http://mercury.com.au/police-check-online/

1 Answers1

0

you have a div inside of a. if you want to add an image, put the div with the image outside of a. if you want to have the image inside of a, put it without div. you can read more about your problem in this topic: Is putting a div inside an anchor ever correct?

Shpytyack Artem
  • 306
  • 2
  • 15