HTML - Links - W3Schools.com

w3schools.com
19 Mar 202403:27

Summary

TLDRIn this video, the focus is on HTML links, explaining their role in web navigation. The script covers how HTML links are defined using the <a> tag with the href attribute specifying the destination. It highlights different types of links, including local and absolute URLs, and explains the visual distinction between unvisited, visited, and active links. The target attribute’s values (_blank, _self, _parent, _top) for opening links in different windows or frames are also discussed. Additionally, the video touches on using images as links and how to add a title attribute for extra information displayed as tooltips.

Takeaways

  • 😀 HTML links are hyper links that allow users to navigate between pages.
  • 😀 Links can be text, images, buttons, or other elements like a person's name.
  • 😀 The syntax for HTML links uses the <a> tag and requires the href attribute to define the destination.
  • 😀 When you hover over a link, the cursor turns into a hand to indicate it is clickable.
  • 😀 Links can be absolute (full URL) or relative (linking within the same website).
  • 😀 By default, links appear in three colors: blue for unvisited, purple for visited, and red for active.
  • 😀 CSS can be used to change the default colors of links.
  • 😀 The target attribute specifies where the linked document should open, with options like '_blank', '_self', '_parent', and '_top'.
  • 😀 Images can also be used as links by wrapping the <img> element inside the <a> element.
  • 😀 The title attribute can be added to a link to provide extra information, typically displayed as a tooltip when hovered over.
  • 😀 In summary, the <a> element defines a link, the href attribute specifies the link address, and the target attribute controls where the document opens.

Q & A

  • What are HTML links and what is their primary function?

    -HTML links, also known as hyperlinks, are clickable elements that allow users to navigate from one web page to another. Their primary function is to facilitate easy navigation by linking to different documents or resources.

  • What happens when you hover your mouse over a link in HTML?

    -When you move your mouse over a link, the mouse pointer changes to a little hand icon, indicating that the text or element is clickable.

  • Can an HTML link be anything other than text? If so, give examples.

    -Yes, an HTML link does not have to be text. It can also be an image, a button, or any other element, allowing a wider variety of clickable content.

  • How are links defined in HTML?

    -Links in HTML are defined using the `<a>` tag, where the `href` attribute specifies the destination address of the link, and the visible part of the link is placed between the opening and closing `<a>` tags.

  • What is the difference between absolute and relative URLs in HTML links?

    -An absolute URL is a full web address (e.g., https://www.example.com), whereas a relative URL points to a resource within the same website, without needing the full address (e.g., /about-us).

  • What are the default styles for HTML links?

    -By default, unvisited links appear as blue and underlined, visited links appear purple and underlined, and active links are red and underlined. These styles can be changed using CSS.

  • What does the `target` attribute in HTML links do?

    -The `target` attribute specifies where the linked document will open. Its values can be '_blank' (opens in a new tab or window), '_self' (opens in the same window/tab), '_parent', '_top', or a named frame.

  • How do you use an image as a link in HTML?

    -To use an image as a link, you wrap the `<img>` element inside an `<a>` element. This allows users to click the image to navigate to the specified link.

  • What is the purpose of the `title` attribute in HTML links?

    -The `title` attribute provides additional information about an element. When you hover over the element, the content of the `title` attribute is displayed as a tooltip.

  • How can you change the default colors of HTML links?

    -The default colors of HTML links (blue, purple, red) can be changed using CSS, allowing customization of link styles for visited, unvisited, and active states.

Outlines

plate

Cette section est réservée aux utilisateurs payants. Améliorez votre compte pour accéder à cette section.

Améliorer maintenant

Mindmap

plate

Cette section est réservée aux utilisateurs payants. Améliorez votre compte pour accéder à cette section.

Améliorer maintenant

Keywords

plate

Cette section est réservée aux utilisateurs payants. Améliorez votre compte pour accéder à cette section.

Améliorer maintenant

Highlights

plate

Cette section est réservée aux utilisateurs payants. Améliorez votre compte pour accéder à cette section.

Améliorer maintenant

Transcripts

plate

Cette section est réservée aux utilisateurs payants. Améliorez votre compte pour accéder à cette section.

Améliorer maintenant
Rate This

5.0 / 5 (0 votes)

Étiquettes Connexes
HTML LinksWeb DevelopmentHTML SyntaxLink TargetsCSS StylingLocal LinksWeb DesignHTML BasicsWeb TutorialWeb NavigationImage Links
Besoin d'un résumé en anglais ?