26. Links and Text Decoration


#1

How do you have a link go to a different webpage once you click on the link? I was typing a link and I wanted the link to go to a different webpage once it's already clicked, but I don't know how to do that.
Please provide an example and the steps to do this, and if necessary, the website where you got all the info. Thank you.


#2

You need to use the <a> tag. Here is a example.

<a href="url">link text</a>

Inside the href quotations should be the address of the website you want the link to go.

Let me know if you need further explain.


#3

I already know that. What I want to know is how to have the link go to another page/ screen when you click on the link. Does that code that you have written do that? If it does, why can't we do it on this website when coding?


#4

Yes it should do that.

I'm not sure what you are referring to.


#5

Ok, let me explain myself better:
Let's say I am writing on the code editor a link of a song I want others to hear on Youtube:
The song is "When a Woman" by Shakira on Youtube.
Here's the code:

Listen to Shakira's "When a Woman" song here.

When I click on that link, I want it to appear on a different screen. I want it to appear on the same exact website that I just wrote on the link. Problem: when I press the link on the code editor, a new screen doesn't show up. Everything stays the same. I thought that maybe there was some other code element that I needed to know to do just what I want to do.

Please write back if you don't understand.

p.s. the code is <a href="https://www.youtube.com/watch?v=v4BqP-uF_sw></a></p>


#7

Honestly still not 100% sure.

Correct me if I am wrong but you want to open up a smaller video player on the same web page that plays that song from YouTube?


#8

What I wanted was the link to take me to the exact URL address that I wrote in the code. Anyway I found the answer to my question here. The solution is to right- click on the link and press "open link in new tab".
Although your answer wasn't what I was looking for, thank you so much for taking your time to help me.
Thank you.


#9

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.