Tutorial How to Easily Create Links in HTML (for Beginners)
You must be familiar with the term “link” because on various websites you can find links in the form of text or images. The question is how do I create a link in an HTML document? To answer this question, in this article I will explain how to insert links into HTML documents and other things related to links.
Links are used as links between one page to another. More specifically, the use of links in HTML is to link the HTML document to another page which is the destination address. A link is a text or image associated with a particular address. In order for you to better understand the material “Link”, consider the explanation below:
a. Use of tags
The use of links in HTML documents is characterized by the use of anchor elements, namely paired tags …… . In browsers, links are generally marked with blue text that has an underline. If you click on text or an image that contains a link, the path of the link will be opened either in the tab itself or in a new tab. The attributes in the tag are as follows:
Attribute | Function |
href | Shows the location of the destination document |
id | Linking style sheets (CSS) or marking locations on a page |
hreflang | Indicates the language used |
type | Note the content type of the destination document |
rail | Describes the relationship of the current document to the destination document |
rev | Describe the relationship between the destination document and the original document |
charger | Specifies the character encoding of web documents |
title | Provide a link title in the form of a tooltip |
Here’s a simple example of using links in HTML:
Penggunaan Link Di HTML Anda sedang belajar HTML di blog Nesaba Media
After you run the HTML code above in the browser it will appear as shown below:
b. Attribute id
href attribute on tag used to indicate a destination file. HTML destination path inside the tag can be followed by using the id attribute which is used to take the reader to a specific section in the document.
. For an example of writing code you can see below:
Penggunaan Link Di HTML Klik Tentang untuk mengetahui informasi mengenai Nesaba Media
Nesabamedia.com merupakan seputar tutorial komputer, internet dan jaringan komputer.
The result in the browser will be like this:
c. title attribute
Penggunaan Link Di HTML Biografi
d. The difference between external links and local links
External Link Untuk mengetahui informasi lengkap mengenai Bill Gates, klik Biografi
After running the HTML code in the browser, it will look like this:
Local Link Klik link ini untuk membaca tutorial belajar piano yang benar
By using local links, you don’t need to write down the full address of the page you want to go to.
Make an image as a link
Gambar sebagai Link Klik tombol dibawah ini jika anda ingin membaca halaman posting.
After you run the HTML code above in the browser, it looks like this:
d. Target attribute on link
Attribute | Function |
_blank | Open the destination web page in a new tab or window |
_self | Opens the destination web page in the current tab or window (default) |
_parent | Open the destination web page in the parent frame |
_top | Opens the destination web page in the currently open tab or window, cancels all frames |
The following is an example of writing code and using the target=”_blank” attribute in HTML:
Penggunaan Target _blank Baca selengkapnya mengenai tutorial HTML hanya di Nesaba Media
After you run the code above in the browser it will appear as shown below:
Post a Comment for "Tutorial How to Easily Create Links in HTML (for Beginners)"