My anchor tag keeps opening up the link on my server

Viewed 103

I have the following line in my html:

<div class="col"><div id="sub-topics" class="sub-topics"><a href="www.google.com" target="_blank"><div class="button raised purple"><div fit/>

Im testing everything on my local server but when i click the button it is opening the link as localhost:8080//www.google.com

how can i redirect it to www.google.com and get rid of my local server from the redirection?

thanks

2 Answers

You are using relative link. Use absolute link and also add a closing anchor tag

<a href="https://www.google.com" target="_blank">link</a>

Use an absolute link like https://google.com/.

Example:

<a href="www.google.com" target="_blank">Bad link</a>
<br/>
<a href="https://www.google.com" target="_blank">Good link</a>

Look at bottom left when hovering on a link to see the path assigned to the link!

Related