{"id":58028,"date":"2023-08-24T17:46:25","date_gmt":"2023-08-24T12:16:25","guid":{"rendered":"https:\/\/www.tothenew.com\/blog\/?p=58028"},"modified":"2024-06-10T15:37:50","modified_gmt":"2024-06-10T10:07:50","slug":"part-6-web-accessibility-focusing-on-visual-representation-of-navigation-links","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/part-6-web-accessibility-focusing-on-visual-representation-of-navigation-links\/","title":{"rendered":"Part 6 &#8211; Web Accessibility: Focusing on Visual Representation of navigation links"},"content":{"rendered":"<p>This is the last example for the web aria accessibility implementation, where we will look at how we can visually represent the links on keyboard navigation.<\/p>\n<p>If you take an example of navigation links, here on <strong>anchor<\/strong> tags, we have a <strong>href<\/strong> attribute, which makes the anchor tag focusable by default where this <strong>black border\/outline<\/strong> comes while navigating through the keyboard TAB key.<\/p>\n<p><span style=\"font-weight: 400;\">But here, we have to manage CSS styling in such a way that it looks presentable and clearly visible; look at the code solution given below.<\/span><\/p>\n<h2><b>\u21d2 Code SNIPPET 4 &#8211;<\/b><\/h2>\n<pre>&lt;!DOCTYPE html&gt;\r\n&lt;html lang=\"en\"&gt;\r\n&lt;head&gt;\r\n&lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" \/&gt;\r\n&lt;style&gt;\r\nbody {\r\nmargin: 0;\r\nfont-family: Arial, Helvetica, sans-serif;\r\n}\r\n\r\n.topnav {\r\noverflow: hidden;\r\nbackground-color: #ccc;\r\nlist-style-type: none;\r\npadding: 0;\r\nmargin: 0;\r\n}\r\n\r\n.topnav a {\r\nfloat: left;\r\ncolor: #000;\r\ntext-align: center;\r\npadding: 14px 16px;\r\ntext-decoration: none;\r\nfont-size: 17px;\r\nborder: 2px solid transparent;\r\nborder-bottom-width: 4px;\r\n}\r\n\r\n.topnav a:hover {\r\ncolor: #fff;\r\n}\r\n\r\n.topnav a:focus-visible {\r\noutline: none;\r\ncolor: #fff;\r\nborder-color: #017ea4;\r\nborder-width: 2px;\r\nborder-bottom-width: 4px;\r\nborder-style: solid;\r\n}\r\n\r\n.topnav a.active {\r\ncolor: white;\r\n}\r\n&lt;\/style&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;ul class=\"topnav\" role=\"list\" aria-label=\"top navigation\"&gt;\r\n&lt;li class=\"item\" role=\"listitem\"&gt;\r\n&lt;a class=\"active\" href=\"#home\" target=\"_self\" aria-label=\"Home\"&gt;Home&lt;\/a&gt;\r\n&lt;\/li&gt;\r\n&lt;li class=\"item\" role=\"listitem\"&gt;\r\n&lt;a href=\"#news\" target=\"_self\" aria-label=\"News\"&gt;News&lt;\/a&gt;\r\n&lt;\/li&gt;\r\n&lt;li class=\"item\" role=\"listitem\"&gt;\r\n&lt;a href=\"#contact\" target=\"_self\" aria-label=\"Contact\"&gt;Contact&lt;\/a&gt;\r\n&lt;\/li&gt;\r\n&lt;li class=\"item\" role=\"listitem\"&gt;\r\n&lt;a href=\"#about\" target=\"_self\" aria-label=\"About\"&gt;About&lt;\/a&gt;\r\n&lt;\/li&gt;\r\n&lt;\/ul&gt;\r\n\r\n&lt;div&gt;\r\n&lt;h2&gt;Top Navigation Example&lt;\/h2&gt;\r\n&lt;\/div&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n\r\n<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-58027\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/08\/Part6-Img1.gif\" alt=\"navigation link\" width=\"600\" height=\"323\" \/><\/pre>\n<p>Here, as you can see, the <strong>navigation links<\/strong> are focusable on keyboard navigation by <strong>blue color border\/outline,<\/strong> which you can customize as per the website&#8217;s theme.<\/p>\n<p>I hope these 6 blogs written on web aria accessibility give you an idea about the accessibility from overview to testing and implementation.<\/p>\n<div class=\"ap-custom-wrapper\"><\/div><!--ap-custom-wrapper-->","protected":false},"excerpt":{"rendered":"<p>This is the last example for the web aria accessibility implementation, where we will look at how we can visually represent the links on keyboard navigation. If you take an example of navigation links, here on anchor tags, we have a href attribute, which makes the anchor tag focusable by default where this black border\/outline [&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":6},"categories":[5868,3429],"tags":[5340,5343,5341,5339],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/58028"}],"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=58028"}],"version-history":[{"count":2,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/58028\/revisions"}],"predecessor-version":[{"id":58246,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/58028\/revisions\/58246"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=58028"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=58028"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=58028"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}