user2339515
user2339515

Reputation: 35

Links not opening with left click

I am having a bit of a problem with my site, i am trying to add a simple link to an external site, but i can't get the link to open without right clicking and selecting open link.

This is the piece of code

<div class="brick1 odd">
                <a href="https://www.google.co.uk/" class="nav-item"</a>
                    <div class="nav-hover"></div>
                    <i class="li_shop"></i>
                    <span>Shop now</span>
                </a>
            </div>

I know it's most likely something simple but i can't seem to pin it down

Thanks

Upvotes: 0

Views: 258

Answers (2)

eidsonator
eidsonator

Reputation: 1325

Aha! The problem is because you are trying to link from an http to an https!

Your anchor tag needs to override the click handler:

<a href="https://www.google.co.uk/" class="nav-item" onclick="return !window.open(this.href,'WINDOW_NAME');" >

Should fix it!

But I would still fix the nesting.

try properly nesting everything, like so:

<div class="brick1 odd">
    <a href="https://www.google.co.uk/" class="nav-item" onclick="return !window.open(this.href,'WINDOW_NAME');">
       <div class="nav-hover">
           <i class="li_shop">
                <span>Shop now</span>
           </i>
       </div>
    </a>
 </div>

Upvotes: 1

beiller
beiller

Reputation: 3135

Syntax error

<a href="https://www.google.co.uk/" class="nav-item">
                    <div class="nav-hover"></div>
                    <i class="li_shop"></i>
                    <span>Shop now</span>
                </a>

Upvotes: 1

Related Questions