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;
}
Thuộc tính target
dùng để xác định xem sẽ mở văn bản được liên kết đó ở đâu, có thể là các giá trị sau: The target
attribute 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
href = "https://www.quantrimang.com/" target = "_ blank"> Access Network Administrator
If the site is closed in the frame, you can use target='_top'
to break the frame.
href = "https://www.quantrimang.com/html/" target = "_ top"> HTML5 Tutorial
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).
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.
href = "https://www.quantrimang.com/html/" title = "Access HTML learning page"> HTML learning page
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 the id
attribute
Then 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
The external path may refer to the URL or the link associated with the current website. The example below uses the full URL.
href = "https://www.quantrimang.com/html/default.asp"> HTML Tutorial
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