{"id":58014,"date":"2023-08-21T13:56:23","date_gmt":"2023-08-21T08:26:23","guid":{"rendered":"https:\/\/www.tothenew.com\/blog\/?p=58014"},"modified":"2024-06-10T15:36:08","modified_gmt":"2024-06-10T10:06:08","slug":"part-3-web-accessibility-practical-approaches-to-implement-accessibility-using-axe-tool","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/part-3-web-accessibility-practical-approaches-to-implement-accessibility-using-axe-tool\/","title":{"rendered":"Part 3 \u2013 Web Accessibility: Practical Approaches to Implement accessibility using Axe tool"},"content":{"rendered":"<p>This is the first example for the web aria accessibility implementation, where we will <span style=\"font-weight: 400;\">understand how this Axe Tool works and look at how we can fix these issues.<br \/>\n<\/span><\/p>\n<p><span style=\"font-weight: 400;\">You can read more about the accessibility implementation from the <\/span><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/Accessibility\"><span style=\"font-weight: 400;\">mdn web docs<\/span><\/a><span style=\"font-weight: 400;\">. But by Installing this Axe Accessibility Linter plugin on the Visual Studio Code, the application will start itself after some time and will show the error messages on the HTML code if there are any, and can implement the accessibility by this tool&#8217;s suggestions.<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-large wp-image-58009\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/08\/Part3-Img1-1024x556.png\" alt=\"Visual Studio Axe Plugin\" width=\"625\" height=\"339\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/08\/Part3-Img1-1024x556.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2023\/08\/Part3-Img1-300x163.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/08\/Part3-Img1-768x417.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/08\/Part3-Img1-1536x834.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2023\/08\/Part3-Img1-624x339.png 624w, \/blog\/wp-ttn-blog\/uploads\/2023\/08\/Part3-Img1.png 1920w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/p>\n<h2><b>\u21d2 Code SNIPPET 1 &#8211;<\/b><\/h2>\n<pre><span style=\"font-weight: 400;\">&lt;!<\/span><span style=\"font-weight: 400;\">DOCTYPE<\/span> <span style=\"font-weight: 400;\">html<\/span><span style=\"font-weight: 400;\">&gt;<\/span>\r\n<span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">html<\/span> <span style=\"font-weight: 400;\">lang<\/span><span style=\"font-weight: 400;\">=<\/span><span style=\"font-weight: 400;\">\"en\"<\/span><span style=\"font-weight: 400;\">&gt;<\/span>\r\n<span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">head<\/span><span style=\"font-weight: 400;\">&gt;<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">meta<\/span> <span style=\"font-weight: 400;\">charset<\/span><span style=\"font-weight: 400;\">=<\/span><span style=\"font-weight: 400;\">\"UTF-8\"<\/span><span style=\"font-weight: 400;\">&gt;<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">meta<\/span> <span style=\"font-weight: 400;\">name<\/span><span style=\"font-weight: 400;\">=<\/span><span style=\"font-weight: 400;\">\"viewport\"<\/span> <span style=\"font-weight: 400;\">content<\/span><span style=\"font-weight: 400;\">=<\/span><span style=\"font-weight: 400;\">\"width=device-width, initial-scale=1.0\"<\/span><span style=\"font-weight: 400;\">&gt;<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">title<\/span><span style=\"font-weight: 400;\">&gt;<\/span><span style=\"font-weight: 400;\">Document<\/span><span style=\"font-weight: 400;\">&lt;\/<\/span><span style=\"font-weight: 400;\">title<\/span><span style=\"font-weight: 400;\">&gt;<\/span>\r\n<span style=\"font-weight: 400;\">&lt;\/<\/span><span style=\"font-weight: 400;\">head<\/span><span style=\"font-weight: 400;\">&gt;<\/span>\r\n<span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">body<\/span><span style=\"font-weight: 400;\">&gt;<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">header<\/span><span style=\"font-weight: 400;\">&gt;&lt;\/<\/span><span style=\"font-weight: 400;\">header<\/span><span style=\"font-weight: 400;\">&gt;<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400;\">&lt;<\/span><span style=\"font-weight: 400;\">main<\/span><span style=\"font-weight: 400;\">&gt;\r\n&lt;div class=\"container\"&gt;\r\n     &lt;div class=\"imageBox\"&gt;\r\n       &lt;img src=\"${download.iconPath}\" class=\"cta-\r\ndownload__icon-img\"&gt;\r\n      &lt;\/div&gt;\r\n     &lt;\/div&gt;\r\n    &lt;\/main&gt;\r\n    &lt;footer&gt;&lt;\/footer&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/span><\/pre>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-large wp-image-58012\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/08\/Part3-Img2-1024x576.png\" alt=\"VS Code Error\" width=\"625\" height=\"352\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/08\/Part3-Img2-1024x576.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2023\/08\/Part3-Img2-300x169.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/08\/Part3-Img2-768x432.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/08\/Part3-Img2-1536x864.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2023\/08\/Part3-Img2-624x351.png 624w, \/blog\/wp-ttn-blog\/uploads\/2023\/08\/Part3-Img2.png 1920w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Here, for this simple code, it shows me the error on this &lt;img&gt; tag in the index.html file, as there is nothing on the image that describes it. So after hovering over the &lt;img&gt; tag, it will show the axe-linter error message where you can click the link highlighted in blue as shown in the above image, and it will show you the solution.<\/span><\/p>\n<h2><b>Error Code for SNIPPET 1 &#8211;<\/b><\/h2>\n<p><strong>axe-linter (image-alt): Ensures &lt;img&gt; elements have alternate text or a role of none or presentation axe-linter(<a href=\"https:\/\/dequeuniversity.com\/rules\/axe\/4.7\/image-alt?application%3Daxe-linter\">image-alt<\/a>)<\/strong><\/p>\n<h3><b>Fix for SNIPPET 1 &#8211;<\/b><\/h3>\n<ol>\n<li><span style=\"font-weight: 400;\">#Fix &#8211; Add <\/span><b>alt<\/b><span style=\"font-weight: 400;\"> attribute.<br \/>\n<\/span>&lt;img src=&#8221;${download.iconPath}&#8221; alt=&#8221;Download image&#8221; class=&#8221;cta-download__icon-img&#8221;&gt;<\/li>\n<li>#Fix &#8211; Using <b>aria-label<\/b> attribute.<br \/>\n&lt;img src=&#8221;${download.iconPath}&#8221; aria-label=&#8221;download image&#8221; class=&#8221;cta-download__icon-img&#8221;&gt;<\/li>\n<li>#Fix &#8211; Using <b>aria-labelledby<\/b> attribute.<br \/>\n&lt;img src=&#8221;${download.iconPath}&#8221; aria-labelledby=&#8221;download image&#8221; class=&#8221;cta-download__icon-img&#8221;&gt;<\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">After following any of these above solutions, the axe-linter accessibility plugin will not show the error.<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-large wp-image-58013\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/08\/Part3-Img3-1024x673.png\" alt=\"VS Code Fix\" width=\"625\" height=\"411\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/08\/Part3-Img3-1024x673.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2023\/08\/Part3-Img3-300x197.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/08\/Part3-Img3-768x505.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/08\/Part3-Img3-1536x1010.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2023\/08\/Part3-Img3-624x410.png 624w, \/blog\/wp-ttn-blog\/uploads\/2023\/08\/Part3-Img3.png 1551w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/p>\n<p>Here, you can see how the code is error-free. There are more implementations in this chain of blogs.<\/p>\n<p>Link to <a href=\"https:\/\/www.tothenew.com\/blog\/part-4-web-accessibility-nvda-screen-reader-for-effective-debugging\/\"><b>Part 4 &#8211; Web Accessibility: NVDA Screen Reader for effective debugging &#8211;\u00a0<\/b><\/a><\/p>\n<div class=\"ap-custom-wrapper\"><\/div><!--ap-custom-wrapper-->","protected":false},"excerpt":{"rendered":"<p>This is the first example for the web aria accessibility implementation, where we will understand how this Axe Tool works and look at how we can fix these issues. You can read more about the accessibility implementation from the mdn web docs. But by Installing this Axe Accessibility Linter plugin on the Visual Studio Code, [&hellip;]<\/p>\n","protected":false},"author":1622,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":10},"categories":[5868,3429],"tags":[5340,5343,5341,5339],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/58014"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/1622"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=58014"}],"version-history":[{"count":5,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/58014\/revisions"}],"predecessor-version":[{"id":58541,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/58014\/revisions\/58541"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=58014"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=58014"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=58014"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}