{"id":30099,"date":"2024-11-12T12:39:24","date_gmt":"2024-11-12T12:39:24","guid":{"rendered":"https:\/\/www.seobility.net\/en\/blog\/wiki\/anchor-tag\/"},"modified":"2025-02-26T12:06:44","modified_gmt":"2025-02-26T12:06:44","slug":"Anchor_Tag","status":"publish","type":"wiki","link":"https:\/\/www.seobility.net\/en\/wiki\/Anchor_Tag","title":{"rendered":"Anchor Tag"},"content":{"rendered":"<h2><span class=\"mw-headline\" id=\"Definition\">Definition<\/span><\/h2>\n<p>Anchor tags are HTML tags that are used to create hyperlinks. Links and hyperlinks form the basis of navigation on the web and are what you click on to move from one page to another on a website. Virtually any element on a page can be wrapped in anchor tags and turned into a link, from plain text to images and other HTML elements.\n<\/p>\n<h2><span class=\"mw-headline\" id=\"Attributes_of_an_anchor_tag\">Attributes of an anchor tag<\/span><\/h2>\n<p>The HTML &lt;a&gt; tag, also known as the anchor tag, accepts a number of different attributes. HTML attributes are data added to the tag to give additional information. Most are optional, but some are required. The anchor tag requires a href attribute at a minimum, but there are many other optional attributes.\n<\/p>\n<p>An example of an HTML anchor tag using several attributes could look like this:\n<\/p>\n<pre>&lt;a href=\"www.google.com\" name=\"google_link\" target=\"_blank\" title=\"Link to Google\"&gt;Link to Google&lt;\/a&gt;\r\n<\/pre>\n<h3><span class=\"mw-headline\" id=\"Href_attribute\">Href attribute<\/span><\/h3>\n<p>The href attribute is required, as this is what creates the link. Href stands for hypertext reference and contains the <a href=\"\/en\/wiki\/URL\" title=\"URL\">URL<\/a> to send users to when they click on the link. In the example above, this is www.google.com.\n<\/p>\n<h3><span class=\"mw-headline\" id=\"Name_attribute\">Name attribute<\/span><\/h3>\n<p>The name attribute is now obsolete as of <a href=\"\/en\/wiki\/HTML5\" title=\"HTML5\">HTML5<\/a>, and instead, it is advised to use the id attribute. Prior to HTML5, the name and id attribute were interchangeable. They were used to give an element a name to identify it for use elsewhere, such as in CSS or javascript.\n<\/p>\n<h3><span class=\"mw-headline\" id=\"Target_attribute\">Target attribute<\/span><\/h3>\n<p>The target attribute is used to describe how the user will be sent to the page in the link. The two most common values are:\n<\/p>\n<ul>\n<li> &#8220;_self&#8221;, which is the default option if not otherwise specified, and sends users to the link within the same browsing context, usually a tab.<\/li>\n<\/ul>\n<ul>\n<li> &#8220;_blank&#8221; opens the anchor link in a new window or tab. This is typically used to link to external pages.<\/li>\n<\/ul>\n<p>Other target attributes include &#8220;_parent&#8221; and &#8220;_top&#8221;, though these are rarely used and were generally applicable when iframes were extensively used, which have since fallen out of favor. They enabled developers to open a link in a parent frame or the topmost frame on a page.\n<\/p>\n<h3><span class=\"mw-headline\" id=\"Title_attribute\">Title attribute<\/span><\/h3>\n<p>The title attribute is used to provide a name for the link. This name will show in several contexts, for example when a user hovers their mouse over the link, and when a user with a screen reader highlights the anchor tag. This is considered optional but is recommended for accessibility purposes.\n<\/p>\n<h3><span class=\"mw-headline\" id=\"Additional_attributes\">Additional attributes<\/span><\/h3>\n<p>The anchor tag supports additional attributes. Some of these are common to other HTML tags, such as &#8216;class&#8217; and &#8216;id&#8217;, but some of them are unique to the anchor tag. They typically apply to very specific use cases.\n<\/p>\n<h4><span class=\"mw-headline\" id=\"Download_attribute\">Download attribute<\/span><\/h4>\n<p>This provides a hint to the browser that the link should trigger a download of the linked content, rather than navigating to it. It can be left blank, in which case a best-guess will be used to specify a filename, but any value entered into the download tag will be used for the suggested filename.\n<\/p>\n<h4><span class=\"mw-headline\" id=\"hreflang_attribute\">hreflang attribute<\/span><\/h4>\n<p>This HTML attribute can be used to specify alternative language versions of the respective web page. This will be a value, such as &#8220;fr&#8221; for French or &#8220;en-GB&#8221; for British English. <a href=\"\/en\/wiki\/Hreflang\" title=\"Hreflang\">Hreflang<\/a> can be useful for providing additional context for search engines and preventing <a href=\"\/en\/wiki\/Duplicate_Content\" title=\"Duplicate Content\">duplicate content<\/a>.\n<\/p>\n<h4><span class=\"mw-headline\" id=\"rel_attribute\">rel attribute<\/span><\/h4>\n<p>The HTML rel attribute allows you to specify a relationship between two pages. This accepts a range of values, including &#8220;canonical&#8221;, &#8220;external&#8221;, and &#8220;help&#8221;. These hint at certain behaviors, such as the link being intended as the canonical version of a page, an <a href=\"\/en\/wiki\/External_Links\" title=\"External Links\">external link<\/a> outside of the control of the website, or that the link contains more information about the current link.\n<\/p>\n<h2><span class=\"mw-headline\" id=\"Importance_for_search_engine_optimization\">Importance for search engine optimization<\/span><\/h2>\n<p>Anchor tags are foundational to how the web works and several attributes within the anchor tag are particularly useful with regards to SEO. Multi-lingual sites are highly recommended to take advantage of the hreflang attribute. In addition, it&#8217;s a common SEO best practice to use a rel=canonical link to designate canonical versions of pages. Otherwise, search engines may consider different URL versions of the same page (e.g. due to URL parameters) as duplicate content which can have a negative impact on search engine rankings.\n<\/p>\n<p>The rel attribute can also contain values such as &#8220;nofollow&#8221;. Nofollow specifies that the linked page should not be followed and crawled by search engines.\n<\/p>\n<h2><span class=\"mw-headline\" id=\"In_summary:_Anchor_tag_FAQs\">In summary: Anchor tag FAQs<\/span><\/h2>\n<p><b>What are anchor tags used for?<\/b>\n<\/p>\n<p>Anchor Tags are used to add hyperlinks to text, images, or other HTML elements.\n<\/p>\n<p><b>How do you create an anchor tag?<\/b>\n<\/p>\n<p>You can create anchor tags in HTML, using the &lt;a&gt; tag combined with one or more attributes.\n<\/p>\n<p><b>What are the most important attributes of an anchor tag?<\/b>\n<\/p>\n<p>The most important attributes are:\n<\/p>\n<ul>\n<li> Href<\/li>\n<li> Name<\/li>\n<li> Target<\/li>\n<li> Title<\/li>\n<\/ul>\n<p><b>How do anchor tags affect SEO?<\/b>\n<\/p>\n<p>Anchor Tags are relevant for SEO as they can be used, for example, to create canonical links in order to avoid duplicate content.<br \/>\n<script type=\"application\/ld+json\">\n{\n  \"@context\": \"https:\/\/schema.org\",\n  \"@type\": \"FAQPage\",\n  \"mainEntity\": [{\n    \"@type\": \"Question\",\n    \"name\": \"What are anchor tags used for?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"Anchor Tags are used to add hyperlinks to text, images, or other HTML elements.\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"How do you create an anchor tag?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"You can create anchor tags in HTML, using the <a> tag combined with one or more attributes.<\/p>\n<p>What are the most important attributes of an anchor tag?\nThe most important attributes are:\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"What are the most important attributes of an anchor tag?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"The most important attributes are:<\/p>\n<ul>\n<li>Href<\/li>\n<li>Name<\/li>\n<li>Target<\/li>\n<li>Title<\/li>\n<\/ul>\n<p>\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"How do anchor tags affect SEO?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"Anchor Tags are relevant for SEO as they can be used, for example, to create canonical links in order to avoid duplicate content.\"\n    }\n  }]\n}\n<\/script>\n<\/p>\n<h2><span class=\"mw-headline\" id=\"Related_links\">Related links<\/span><\/h2>\n<ul>\n<li> <a rel=\"nofollow\" class=\"external free\" href=\"https:\/\/www.w3schools.com\/tags\/tag_a.asp\">https:\/\/www.w3schools.com\/tags\/tag_a.asp<\/a><\/li>\n<\/ul>\n<h2><span class=\"mw-headline\" id=\"Similar_articles\">Similar articles<\/span><\/h2>\n<ul>\n<li> <a href=\"\/en\/wiki\/Canonical_Tag\" title=\"Canonical Tag\">Canonical Tag<\/a><\/li>\n<li> <a href=\"\/en\/wiki\/External_Links\" title=\"External Links\">External Links<\/a><\/li>\n<\/ul>\n<p><script type=\"application\/ld+json\">\n{\n  \"@context\": \"https:\/\/schema.org\",\n  \"@type\": \"Article\",\n  \"author\": {\n    \"@type\": \"Organization\",\n    \"name\": \"Seobility\",\n    \"url\": \"https:\/\/www.seobility.net\/\"\n  }\n}\n<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Definition Anchor tags are HTML tags that are used to create hyperlinks. Links and hyperlinks form the basis of navigation on the web and are what you click on to move from one page to another on a website. Virtually any element on a page can be wrapped in anchor tags and turned into a [&hellip;]<\/p>\n","protected":false},"author":38,"featured_media":0,"comment_status":"open","ping_status":"open","template":"","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"class_list":["post-30099","wiki","type-wiki","status-publish","hentry","wiki_categories-web-development"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Anchor Tag: Definition and Attributes - Seobility Wiki<\/title>\n<meta name=\"description\" content=\"Anchor tags are used to create hyperlinks. Virtually any element on a page can be wrapped in anchor tags and turned into a link. Continue reading...\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.seobility.net\/en\/wiki\/Anchor_Tag\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Anchor Tag: Definition and Attributes - Seobility Wiki\" \/>\n<meta property=\"og:description\" content=\"Anchor tags are used to create hyperlinks. Virtually any element on a page can be wrapped in anchor tags and turned into a link. Continue reading...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.seobility.net\/en\/wiki\/Anchor_Tag\" \/>\n<meta property=\"og:site_name\" content=\"Seobility\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/seobility.net\/\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-26T12:06:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.seobility.net\/wp-content\/uploads\/2025\/06\/seobility-og-image.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@seobility_net\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"ScholarlyArticle\",\"@id\":\"https:\\\/\\\/www.seobility.net\\\/en\\\/wiki\\\/Anchor_Tag#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.seobility.net\\\/en\\\/wiki\\\/Anchor_Tag\"},\"author\":{\"name\":\"Seobility Wiki Team\",\"@id\":\"https:\\\/\\\/www.seobility.net\\\/en\\\/#\\\/schema\\\/person\\\/c838e66a3b46262b4c963df5cd5b2d8a\"},\"headline\":\"Anchor Tag\",\"datePublished\":\"2024-11-12T12:39:24+00:00\",\"dateModified\":\"2025-02-26T12:06:44+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.seobility.net\\\/en\\\/wiki\\\/Anchor_Tag\"},\"wordCount\":848,\"commentCount\":0,\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.seobility.net\\\/en\\\/wiki\\\/Anchor_Tag#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.seobility.net\\\/en\\\/wiki\\\/Anchor_Tag\",\"url\":\"https:\\\/\\\/www.seobility.net\\\/en\\\/wiki\\\/Anchor_Tag\",\"name\":\"Anchor Tag: Definition and Attributes - Seobility Wiki\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.seobility.net\\\/en\\\/#website\"},\"datePublished\":\"2024-11-12T12:39:24+00:00\",\"dateModified\":\"2025-02-26T12:06:44+00:00\",\"description\":\"Anchor tags are used to create hyperlinks. Virtually any element on a page can be wrapped in anchor tags and turned into a link. Continue reading...\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.seobility.net\\\/en\\\/wiki\\\/Anchor_Tag#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.seobility.net\\\/en\\\/wiki\\\/Anchor_Tag\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.seobility.net\\\/en\\\/wiki\\\/Anchor_Tag#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.seobility.net\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Wiki\",\"item\":\"https:\\\/\\\/www.seobility.net\\\/en\\\/wiki\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Anchor Tag\",\"item\":\"https:\\\/\\\/www.seobility.net\\\/en\\\/wp-json\\\/wp\\\/v2\\\/wiki\\\/30099\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.seobility.net\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/www.seobility.net\\\/en\\\/\",\"name\":\"Seobility\",\"description\":\"Online SEO Software &amp; Tools For Better Rankings\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.seobility.net\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.seobility.net\\\/en\\\/#\\\/schema\\\/person\\\/c838e66a3b46262b4c963df5cd5b2d8a\",\"name\":\"Seobility Wiki Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.seobility.net\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/Seobility-S-2025-150x150.png\",\"url\":\"https:\\\/\\\/www.seobility.net\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/Seobility-S-2025-150x150.png\",\"contentUrl\":\"https:\\\/\\\/www.seobility.net\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/Seobility-S-2025-150x150.png\",\"caption\":\"Seobility Wiki Team\"},\"description\":\"The Seobility Wiki team consists of seasoned SEOs, digital marketing professionals, and business experts with combined hands-on experience in SEO, online marketing and web development. All our articles went through a multi-level editorial process to provide you with the best possible quality and truly helpful information. Learn more about the people behind the Seobility Wiki.\",\"url\":\"https:\\\/\\\/www.seobility.net\\\/en\\\/blog\\\/author\\\/seobility-wiki-team\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Anchor Tag: Definition and Attributes - Seobility Wiki","description":"Anchor tags are used to create hyperlinks. Virtually any element on a page can be wrapped in anchor tags and turned into a link. Continue reading...","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.seobility.net\/en\/wiki\/Anchor_Tag","og_locale":"en_US","og_type":"article","og_title":"Anchor Tag: Definition and Attributes - Seobility Wiki","og_description":"Anchor tags are used to create hyperlinks. Virtually any element on a page can be wrapped in anchor tags and turned into a link. Continue reading...","og_url":"https:\/\/www.seobility.net\/en\/wiki\/Anchor_Tag","og_site_name":"Seobility","article_publisher":"https:\/\/www.facebook.com\/seobility.net\/","article_modified_time":"2025-02-26T12:06:44+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/www.seobility.net\/wp-content\/uploads\/2025\/06\/seobility-og-image.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_site":"@seobility_net","twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"ScholarlyArticle","@id":"https:\/\/www.seobility.net\/en\/wiki\/Anchor_Tag#article","isPartOf":{"@id":"https:\/\/www.seobility.net\/en\/wiki\/Anchor_Tag"},"author":{"name":"Seobility Wiki Team","@id":"https:\/\/www.seobility.net\/en\/#\/schema\/person\/c838e66a3b46262b4c963df5cd5b2d8a"},"headline":"Anchor Tag","datePublished":"2024-11-12T12:39:24+00:00","dateModified":"2025-02-26T12:06:44+00:00","mainEntityOfPage":{"@id":"https:\/\/www.seobility.net\/en\/wiki\/Anchor_Tag"},"wordCount":848,"commentCount":0,"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.seobility.net\/en\/wiki\/Anchor_Tag#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.seobility.net\/en\/wiki\/Anchor_Tag","url":"https:\/\/www.seobility.net\/en\/wiki\/Anchor_Tag","name":"Anchor Tag: Definition and Attributes - Seobility Wiki","isPartOf":{"@id":"https:\/\/www.seobility.net\/en\/#website"},"datePublished":"2024-11-12T12:39:24+00:00","dateModified":"2025-02-26T12:06:44+00:00","description":"Anchor tags are used to create hyperlinks. Virtually any element on a page can be wrapped in anchor tags and turned into a link. Continue reading...","breadcrumb":{"@id":"https:\/\/www.seobility.net\/en\/wiki\/Anchor_Tag#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.seobility.net\/en\/wiki\/Anchor_Tag"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.seobility.net\/en\/wiki\/Anchor_Tag#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.seobility.net\/en\/"},{"@type":"ListItem","position":2,"name":"Wiki","item":"https:\/\/www.seobility.net\/en\/wiki"},{"@type":"ListItem","position":3,"name":"Anchor Tag","item":"https:\/\/www.seobility.net\/en\/wp-json\/wp\/v2\/wiki\/30099"}]},{"@type":"WebSite","@id":"https:\/\/www.seobility.net\/en\/#website","url":"https:\/\/www.seobility.net\/en\/","name":"Seobility","description":"Online SEO Software &amp; Tools For Better Rankings","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.seobility.net\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.seobility.net\/en\/#\/schema\/person\/c838e66a3b46262b4c963df5cd5b2d8a","name":"Seobility Wiki Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.seobility.net\/wp-content\/uploads\/2025\/06\/Seobility-S-2025-150x150.png","url":"https:\/\/www.seobility.net\/wp-content\/uploads\/2025\/06\/Seobility-S-2025-150x150.png","contentUrl":"https:\/\/www.seobility.net\/wp-content\/uploads\/2025\/06\/Seobility-S-2025-150x150.png","caption":"Seobility Wiki Team"},"description":"The Seobility Wiki team consists of seasoned SEOs, digital marketing professionals, and business experts with combined hands-on experience in SEO, online marketing and web development. All our articles went through a multi-level editorial process to provide you with the best possible quality and truly helpful information. Learn more about the people behind the Seobility Wiki.","url":"https:\/\/www.seobility.net\/en\/blog\/author\/seobility-wiki-team\/"}]}},"_links":{"self":[{"href":"https:\/\/www.seobility.net\/en\/wp-json\/wp\/v2\/wiki\/30099","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.seobility.net\/en\/wp-json\/wp\/v2\/wiki"}],"about":[{"href":"https:\/\/www.seobility.net\/en\/wp-json\/wp\/v2\/types\/wiki"}],"author":[{"embeddable":true,"href":"https:\/\/www.seobility.net\/en\/wp-json\/wp\/v2\/users\/38"}],"replies":[{"embeddable":true,"href":"https:\/\/www.seobility.net\/en\/wp-json\/wp\/v2\/comments?post=30099"}],"version-history":[{"count":0,"href":"https:\/\/www.seobility.net\/en\/wp-json\/wp\/v2\/wiki\/30099\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.seobility.net\/en\/wp-json\/wp\/v2\/media?parent=30099"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}