• HTML links, which are also known as hyperlinks, are used to link other web resources to an HTML document, where the resources could be web pages, websites, texts, images, or other types of media (Gupta, 2021).
  • Links can also be used to trigger JavaScript but it is not recommended, because links that do not go anywhere should be replaced by buttons, since that is what the button element is for (Heilmann, 2019).
  • A hyperlink is created using <a> element or anchor, which is the most important elements of HTML (Leverenz, 2023).

html tags Link to heading

  • In a document entitled HTML Tags, there is description of the first 18 HTML tags, <title>, <nextid>, <a>, <isindex>, <plaintext>, <listing>, <p>, <h1><h6>, <address>, <hp1>, <hp2> …, <dl>, <dt>, <dd>, <ul>, <li>, <menu> and <dir> (Berners-Lee, 1991).
  • Today there are about at least 30 HTML tags in HTML 5 (MacTavish, 2022).
  • Supports of tags for image, and audio & video are added in different version of HTML as the history tells (Prasad, 2022).

html elements and tags Link to heading

  • The concept of HTML elements and tags are closely related, to say in short, tags have elements in them, while elements are encapsulated in tags (Singh, 2023).
  • Elements are made up of tags, but tags are not made up of elements, and elements are the building blocks or HTML (Garbarino, 2023).
  • An HTML element consists of a start tag, some content, and an end tag, there might be also some attributes in the tag such as class or id name (Negi, 2023).

example of tag and element Link to heading

  • Loot at the following example.
    <h2>A section</h2>
    
    <div>
    This is the first paragraph. This is the first paragraph.
    This is the first paragraph. This is the first paragraph.
    This is the first paragraph.
    </div>
    
    <div>
    And now this is the second paragraph. It is the second one.
    This is the second paragraph. Yes, it is.
    </div>
    
  • How many tags and elements used in the previous examples?
  • See the result on OneCompiler/3zkfnwrge, which is stil without style.

element, tag, attribute, content Link to heading

  • An element is defined using start tag, attribute, and end tag.
  • It might also has content.
    <div id="par-1" class="normal" style="color:blue;">
    It is an example of a paragraph which is a div element,
    with id par-1, class normal, and font color blue.
    </div>
    
  • See the result on OneCompiler/3zkfpf8ux.
  • This example has three attributes
    • id of par-1,
    • class of normal, and
    • style of color:blue;.
  • The last attribute changes the font color from black, as default color, to blue.

url, uri, urn Link to heading

  • While most developers know what a URL is, not everyone knows what a URI is, and even less knows about URNs, well not to mention that the relationships between theses terms is not always very clear (Chiarelli, 2022).
  • In simple words, a URI can be a URN or a URL because both are subtypes of URI (Miessler, 2005).
  • URI is a string of characters used to identify or name a resource, which can include URLs, URNs, or other forms, where for URN the scheme is always urn and it is used uniquely identify a resource without specifying its location, providing a persistent and globally unique name for the resource and the name remains valid even its data is moved to another location (Smolchenko, 2023).
  • Attribute href of <a> element can have value of a URL for other web document or URI fragment, the #, for section in the same the document (Juviler, 2021).

href attribute and content Link to heading

  • In an anchor element there are begin tag, attribute, content, and end tag.

    • begin tag <a>.
    • end tag </a>.
    • content is placed between begin and end tags.
    • attribute, e.g. href="url" is placed between a and > in begin tag.
  • Example of an anchor element

    <a href="https://github.com/">GitHub</a>
    

    which produces result

    GitHub

    as in OneCompiler/3zkguv5zc.

  • Notice that the content or displayed text can be different than the actual the value of href attribute, which is the flexibility of anchor element.