Table of Contents
This guide covers paths in HTML with practical context and easy-to-follow details. Use it to understand the subject and apply the information confidently.
What Is the Path in HTML?
The paths in HTML are hyperlinks. Clicking on it will take you to another document. When hovering over the path, the mouse's arrow icon changes to a hand icon.
Note: The path is not necessarily text, it may be an image or other HTML elements.
Syntax Path in HTML
In HTML, the path is defined by the tag
href = "url"> text for the path
For example
ThehrefAttribute is used to determine the address of a specific destination. (HTTPS: //TipsMake. Com/HTML/) The text for the path is the part that will be displayed, clicking here will take you to that address.
Note: If you do not use a slash for the subdirectory address, it may create 2 requests to the server. Many servers automatically add a dash to create a request.
Local Link Local Path
The example above uses the URL for both the website, the internal link (link to the same website) specified by the relevant URL (no need to HTTPS: // www. )
href = "html_images.asp"> HTML images
HTML Path Colors
By default the link appears as follows (on all browsers)
- Unused / clicked links (unvisit) are blue and underlined
- The path has been visited / clicked on (visit) purple and underlined
- The active (red) path is red and underlined
You can change the default color with CSS.
For example
le> le> a:link {color: green;background-color: transparent;text-decoration: none;}a:visited {color: pink;background-color: transparent;text-decoration: none;}a:hover {color: red;background-color: transparent;text-decoration: underline;}a:active {color: yellow;background-color: transparent;text-decoration: underline;}
Thuoc Tinh Target Target Attribute
Thuoc tinhtargetDung e xac inh xem se mo van ban uoc lien ket o o au, co the la cac gia tri sau: ThetargetAttribute is used to determine where the linked text will be opened, which can be the following values:
_blank opens in a new window or tab _self opens at the same window / tab (default) _parent opens in the parent frame _top open in the entire window Framename opens in the naming frame (named frame)
The following example opens the text in the new window / tab
If the site is closed in the frame, you can usetarget='_top'To break the frame.
Path as image
a href="default.asp">
style="width:42px;height:42px;border:0;">
>
border:0'Is added to prevent IE9 (and backwards) from showing the border around the image (when the image is a path).
Path Title
The title attribute is used to specify additional information for the element. Information is usually displayed in the form of tooltip when pointing over the element.
How to Create Bookmark
Bookmarking in HTML is used to make it easier for readers to go to other parts of the site. Bookmarking is useful when the webpage is too long.
You must first create a bookmark and then add the path to it. When clicking on the link, the page will scroll to the address that bookmarked it.
Create a bookmark with theidAttribute
Id == "C16"> Chapter 16
Next, add the path to the bookmark (Go to Chapter 16) from the same page
Go to Ch??ng 16
Attach the path to the bookmark (Go to Chapter 16) from another page
href = "html_demo.html # C4"> Go to Chapter 16
External Path
The external path may refer to the URL or the link associated with the current website. The example below uses the full URL.
The example below leads to the website in the HTML directory of the same website
href = "/ html / default.asp"> HTML Tutorial
The example below leads to the site located in the same directory of the same current page
href = "default.asp"> HTMLl Tutorial
Previous article: Style for HTML with CSS
The following article: Images in HTML
FAQ
What should I check before following these steps?
Confirm device and software compatibility, save important data, and make sure you have the required permissions, files, and account access.
Why might the process not work?
Common causes include outdated software, missing permissions, incompatible hardware, an unstable connection, or completing a step in the wrong order.
Can I undo the changes if necessary?
That depends on the tool or setting. Use built-in restore options when available, keep a backup, and record the original configuration first.
Reader Comments 0
Sign in with email or Google to join the discussion.