The link from my main DIV does not work if I have a link in my internal DIV

1

I have one DIV within another, but my main DIV does not work the link if I put inside it a DIV with a link to close.

CSS:

#guaraparivirtualsuperpopup {
    position:relative;
    width:1215px;
    height:500px;
    background-color:#000000;
    /* background-image:url(http://www.guaraparivirtual.com.br/Lay_Out/dr-bruno.jpg);
    background-repeat:no-repeat;
    background-position:50% 50%;
    */
    margin: 0 auto;

    border: 1px solid #EA8419;
}
#guaraparivirtualsuperpopupbtn {
    width:100px;
    height:36px;
    background-image:url(http://www.guaraparivirtual.com.br/img-novo/fechar.png);
    background-repeat:no-repeat;
    float:right;
    position: relative;

}

JavaScript

<script type="text/javascript">
function superpopgv(guaraparivirtualsuperpopup) {

    if(document.getElementById(guaraparivirtualsuperpopup).style.display=="none") {
        document.getElementById(guaraparivirtualsuperpopup).style.display = "inline";
    }
    else {
        document.getElementById(guaraparivirtualsuperpopup).style.display = "none";
    }

}
</script>

DIV's

<a href="<?php echo $linkbannerrt; ?>" target="_blank" title="Super Pop-Up" / >
<div id="guaraparivirtualsuperpopup" style="background-image:url(superpopup/<?php echo $rt; ?>);">


<a href="#" onclick="javascript: superpopgv('guaraparivirtualsuperpopup');" />
<div id="guaraparivirtualsuperpopupbtn"></div>
</a>

</div>
</a>

Your self placed this link

<a href="#" onclick="javascript: superpopgv('guaraparivirtualsuperpopup');" />

The link below does not work

<a href="<?php echo $linkbannerrt; ?>" target="_blank" title="Super Pop-Up" / > 

How do you solve it?

    
asked by anonymous 08.08.2016 / 23:11

2 answers

1

The link you are referring to is not below from the other link, but rather INSIDE from the other link.

I put it in separate tags ... See the code snippet below:

function superpopgv(guaraparivirtualsuperpopup) {

       if(document.getElementById(guaraparivirtualsuperpopup).style.display=="none") {
        document.getElementById(guaraparivirtualsuperpopup).style.display = "inline";
    }
    else {
        document.getElementById(guaraparivirtualsuperpopup).style.display = "none";
    }

}
#guaraparivirtualsuperpopup {
    position:relative;
    width:1215px;
    height:500px;
    background-color:#000000;
   /* background-image:url(http://www.guaraparivirtual.com.br/Lay_Out/dr-bruno.jpg);
    background-repeat:no-repeat;
    background-position:50% 50%;
    */
    margin: 0 auto;
    border: 1px solid #EA8419;
}
#guaraparivirtualsuperpopupbtn {
    width:100px;
    height:36px;
    background-image:url(http://www.guaraparivirtual.com.br/img-novo/fechar.png);
    background-repeat:no-repeat;
    float:right;
    position: relative;

}
<a href="http://www.testedolink.com.br/" target="_blank" title="Super Pop-Up">Link 1</a>

<div id="guaraparivirtualsuperpopup" style="background-image:url(http://lorempixel.com/output/food-h-c-207-324-10.jpg);">


<a href="#" onclick="javascript: superpopgv('guaraparivirtualsuperpopup');" >
<div id="guaraparivirtualsuperpopupbtn">Link2</div>
</a>

</div>

I hope to have helped, any question is just to post a comment.

    
08.08.2016 / 23:43
0

You can not place a link inside another link. For existing HTML specs for w3, you can not. This restriction was actually enforced by HTML5 browsers.

link

Maybe you'd better mount your screen in another way.

    
08.08.2016 / 23:38