• HTML
  • React
  • Knowledge Base
  • HTML
  • React
  • Knowledge Base
  • HTML Tutorial
  • HTML Styles – CSS
  • Link to an Email Address
  • HTML Introduction
  • HTML Editors
  • HTML Basic Examples
  • HTML Elements
  • HTML Attributes
  • HTML Headings
  • HTML Paragraphs
  • HTML Styles
  • HTML Text Formatting
  • HTML Quotation and Citation Elements
  • HTML Comments
  • HTML Colors
  • HTML RGB and RGBA Colors
  • HTML HEX Colors
  • HTML HSL and HSLA Colors
  • CSS Colors, Fonts and Sizes
  • CSS Padding
  • CSS Border
  • CSS Margin
  • Link to External CSS
  • HTML Style Tags
  • HTML Links
  • HTML Links – The target Attribute
  • Absolute URLs vs. Relative URLs
  • HTML Links – Use an Image as a Link
  • Button as a Link
  • Link Titles
  • Absolute URLs and Relative URLs
  • HTML Link Tags
  • HTML Links – Different Colors
  • Link Buttons
  • HTML Links – Create Bookmarks
  • The alt Attribute
  • HTML Images
  • Image Size – Width and Height
  • Image Width and Height, or Style
  • Images in Another Folder
  • HTML Images on Another Server/Website
  • HTML Animated Images
  • Image as a Link
  • Image Floating
  • Common Image Formats
  • HTML Image Tags
  • The render Method

HTML Links

4 views 0

Written by admin
April 15, 2023

HTML links are used to create hyperlinks between web pages, or to link to other resources such as images, videos, or documents. To create a link in HTML, you use the <a> (anchor) tag.

Here is an example of how to create a hyperlink in HTML:

<!DOCTYPE html>
<html>
  <head>
    <title>My Web Page</title>
  </head>
  <body>
    <h1>Welcome to my web page!</h1>
    <p>Check out my <a href="https://www.example.com">favorite website</a>.</p>
  </body>
</html>

In this example, the <a> tag is used to create a hyperlink to the website https://www.example.com. The href attribute of the <a> tag specifies the destination of the hyperlink.

When a user clicks on the hyperlink, they will be taken to the specified web page or resource. The text within the <a> tag is typically underlined and displayed in a different color than the surrounding text to indicate that it is a hyperlink.

You can also create links to other pages within your own website by using relative URLs instead of absolute URLs. For example:

<p>Check out my <a href="about.html">about page</a>.</p>

In this example, the href attribute specifies a relative URL (about.html) instead of an absolute URL. This would create a link to an about.html page located in the same directory as the current HTML document.

Links can also be styled using CSS to change their appearance, such as their color, text decoration, and more.

Was this helpful?

Yes  No
Related Articles
  • The render Method
  • HTML Image Tags
  • Common Image Formats
  • Image Floating
  • Image as a Link
  • HTML Animated Images

Didn't find your answer? Contact Us

Leave A Comment Cancel reply

Previously
HTML Style Tags
Up Next
HTML Links – The target Attribute
Copyright 2022 k-window. All Rights Reserved