HTML coding links using notepad ++

Joined
Aug 13, 2024
Messages
1
Reaction score
0
Hi guys,
I'm new to using basic Notepad ++ code and also using w3schools coding website.
The issue I have is trying to make a hyperlink from a word in a paragraph to another webpage.
Any ideas?
Thanks in advance.
 
Joined
Jul 4, 2023
Messages
453
Reaction score
54
Have you tried?
HTML:
<!-- The link will open in the same window -->
<p>
  Lorem ipsum
  <a href="https://www.w3schools.com/html/html_links.asp">link</a>
  dolore sit ament.
</p>

or
HTML:
<!-- The link will open in a new window -->
<p>
  Lorem ipsum
  <a href="https://www.w3schools.com/tags/att_a_target.asp" target="_blank">link</a>
  dolore sit ament.
</p>

or
HTML:
<!-- The link to navigate in the same window -->
<style>
  html,
  body {
    margin: 1rem;
    padding: 0;
    scroll-behavior: smooth;
  }
  h2 {
    scroll-margin-top: 1rem;
  }
  a {
    color: red;
  }
  a:hover {
    text-decoration: none;
  }
  .blank {
    height: 200vh;
    background-color: whitesmoke;
  }
</style>

<h1>Lorem ipsum</h1>

<h2 id="top-page">Lorem ipsum 1</h2>
<p>
  Lorem ipsum
  <a href="#bottom-page">bottom</a>
  dolore sit ament.
</p>

<p class="blank"></p>

<h2 id="bottom-page">Lorem ipsum 2</h2>
<p>
  Lorem ipsum
  <a href="#top-page">top</a>
  dolore sit ament.
</p>
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,879
Messages
2,569,939
Members
46,232
Latest member
DeniseMcVi

Latest Threads

Top