26. Links and Text Decoration

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.

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.

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?

Yes it should do that. [quote=“whimpyashley, post:3, topic:86736”]
If it does, why can’t we do it on this website when coding?
[/quote]

I’m not sure what you are referring to.

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>

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?

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.

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