Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele Working with Links | Section
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
HTML Basics for Absolute Beginners (Sliced) - 1768407373666

bookWorking with Links

Links, also known as hyperlinks, enable users to navigate between web pages, resources, and various forms of communication. In HTML, links are created using the <a> (anchor) tag.

<a href="href-value">some text</a>

The href attribute within the <a> tag specifies the destination of the link. It can accept various types of URLs, including:

  • Absolute URLs: Specify the complete address of the linked resource, including the protocol (e.g., "https://www.example.com");
  • Telephone URLs: Allows users to initiate phone calls directly from the browser when clicked. Formatted as "tel:phone-number". It's essential to include the country code and remove any special characters or spaces from the phone number (e.g., "tel:+123456789");
  • Email URLs: Allows users to compose emails when clicked. Formatted as "mailto:email-address". It's important to include the complete email address after mailto: (e.g., "mailto:example@example.com").

Example:

index.html

index.html

copy

In the example above:

  • The <a> tag creates hyperlinks with different destinations;
  • The href attribute specifies various URLs, including absolute URLs, telephone numbers, and email addresses.

Other useful attributes

The <a> tag has several attributes that can be used to specify hyperlink properties. Some common attributes include:

  • target="_blank": Specifies where to open the linked document. "_blank" opens the link in a new window or tab;
  • download: Specifies that the target will be downloaded when the user clicks the hyperlink. This attribute can have a value to specify the filename for saving the resource.

Example:

index.html

index.html

copy

In this example:

  • The href attribute specifies the URL of the linked resource;
  • The target attribute opens the link in a new window or tab.

1. How are links created?

2. What does the href attribute specify in an <a> tag?

question mark

How are links created?

Select the correct answer

question mark

What does the href attribute specify in an <a> tag?

Select the correct answer

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 1. Luku 12

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

bookWorking with Links

Pyyhkäise näyttääksesi valikon

Links, also known as hyperlinks, enable users to navigate between web pages, resources, and various forms of communication. In HTML, links are created using the <a> (anchor) tag.

<a href="href-value">some text</a>

The href attribute within the <a> tag specifies the destination of the link. It can accept various types of URLs, including:

  • Absolute URLs: Specify the complete address of the linked resource, including the protocol (e.g., "https://www.example.com");
  • Telephone URLs: Allows users to initiate phone calls directly from the browser when clicked. Formatted as "tel:phone-number". It's essential to include the country code and remove any special characters or spaces from the phone number (e.g., "tel:+123456789");
  • Email URLs: Allows users to compose emails when clicked. Formatted as "mailto:email-address". It's important to include the complete email address after mailto: (e.g., "mailto:example@example.com").

Example:

index.html

index.html

copy

In the example above:

  • The <a> tag creates hyperlinks with different destinations;
  • The href attribute specifies various URLs, including absolute URLs, telephone numbers, and email addresses.

Other useful attributes

The <a> tag has several attributes that can be used to specify hyperlink properties. Some common attributes include:

  • target="_blank": Specifies where to open the linked document. "_blank" opens the link in a new window or tab;
  • download: Specifies that the target will be downloaded when the user clicks the hyperlink. This attribute can have a value to specify the filename for saving the resource.

Example:

index.html

index.html

copy

In this example:

  • The href attribute specifies the URL of the linked resource;
  • The target attribute opens the link in a new window or tab.

1. How are links created?

2. What does the href attribute specify in an <a> tag?

question mark

How are links created?

Select the correct answer

question mark

What does the href attribute specify in an <a> tag?

Select the correct answer

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 1. Luku 12
some-alt