Thẻ neo HTML xác định một siêu liên kết liên kết một trang với một trang khác. Nó có thể tạo siêu liên kết đến trang web khác cũng như tệp, vị trí hoặc bất kỳ URL nào. Thuộc tính "href" là thuộc tính quan trọng nhất của thẻ HTML. và liên kết nào đến trang đích hoặc URL
thuộc tính href của thẻ neo HTML
Thuộc tính href được sử dụng để xác định địa chỉ của tệp được liên kết. Nói cách khác, nó chỉ ra trang đích
Cú pháp của thẻ neo HTML được đưa ra dưới đây
Link Text
Hãy xem một ví dụ về thẻ neo HTML
Kiểm tra nó ngay bây giờChỉ định vị trí cho Liên kết bằng thuộc tính đích
Nếu chúng ta muốn mở liên kết đó đến một trang khác thì chúng ta có thể sử dụng thuộc tính đích của thẻ. Với sự giúp đỡ của liên kết này sẽ được mở trong trang tiếp theo
HTML Link Name
Thuộc tính. Thẻ neo chứa nhiều thuộc tính được liệt kê bên dưới
- HTML charset Attribute: This attribute is used to specifies the character-set. It is not supported by HTML 5.
- HTML download Attribute: It is used to specify the target link to download when the user clicks.
- HTML hreflang Attribute: It is used to specify the language of the linked document.
- HTML media Attribute: It is used to specify the linked media.
- HTML coords Attribute: It is used to specify the coordinate of links. It is not supported by HTML 5.
- HTML name Attribute: It is used to specify the anchor name. It is not supported by HTML 5 you can use the global id attribute instead.
- HTML rel Attribute: It is used to specify the relation between the current document and the linked document.
- HTML shape Attribute: It is used to specify the shape of the link. It is not supported by HTML 5.
- HTML type Attribute: It is used to specify the type of links.
- HTML target Attribute: It specifies the target link.
- HTML rev Attribute: It is used to specify the relation between the linked document and the current document. It is not supported by HTML 5.
ví dụ 1. Trong ví dụ này, trang Hướng dẫn HTML GeeksforGeeks sẽ mở ra khi bạn nhấp vào liên kết Hướng dẫn HTML GeeksforGeeks
HTML
_______3____4____5