{"id":1668,"date":"2019-06-15T18:00:38","date_gmt":"2019-06-15T18:00:38","guid":{"rendered":"https:\/\/webdevtrick.com\/?p=1668"},"modified":"2019-06-15T18:00:38","modified_gmt":"2019-06-15T18:00:38","slug":"highlight-current-page","status":"publish","type":"post","link":"https:\/\/webdevtrick.com\/highlight-current-page\/","title":{"rendered":"Highlight Current Page With HTML CSS JS | Show Active Link Or Menu"},"content":{"rendered":"<p><strong>How we can highlight the current page, menu, or link? We can do this with HTML CSS &amp; JavaScript. Check Out This Highlight Current Page With HTML CSS JS, Show Active Link Or Menu.<\/strong><\/p>\n<p>I am sure that, You have seen <strong>underline on the current menu<\/strong> or page on mostly all websites. When we click on any websites about then an underline appears on about <span><a href=\"https:\/\/webdevtrick.com\/css-grid-menu\/\" target=\"_blank\" rel=\"noopener noreferrer\"> menu<\/a><\/span>&#8216;s bottom section. On some websites has any special effect to <strong>indicate the current opened menu or link<\/strong>.<\/p>\n<p>Today you will learn how to <strong>show the active link<\/strong>, <strong>page<\/strong>, or <strong>menu<\/strong> with an<strong> underline<\/strong>. You can do this <strong>using HTML, CSS, &amp; JavaScript<\/strong>, After learning this you can use it everywhere like on your website or blog. Just you have to change class and id values on your <span><a href=\"https:\/\/webdevtrick.com\/css-responsive-navbar\/\" target=\"_blank\" rel=\"noopener noreferrer\">navbar<\/a><\/span> then your website&#8217;s menu will be like this.<\/p>\n<p>So, Today I am sharing <strong>Highlight Current Page With HTML CSS JavaScript<\/strong>. In other words, <strong>Show active link<\/strong>, menu, or page.\u00a0 This program is pure <span><a href=\"https:\/\/webdevtrick.com\/web-development\/javascript\/\" target=\"_blank\" rel=\"noopener noreferrer\">JavaScript<\/a><\/span> based program, I did not use any library. Its is a tricky program, But if you have the capability to understand the code then you will get it. Otherwise, just copy the codes and change as you want.<\/p>\n<p>If you are thinking now how this active link highlighter actually is, Then see the <strong>preview<\/strong> given below.<\/p>\n<h3>Preview Of Show Active Link Menu &amp; Page<\/h3>\n<p>See this video preview to getting an idea of how this looks like.<\/p>\n<div style=\"width: 640px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-1668-1\" width=\"640\" height=\"288\" loop autoplay preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/webdevtrick.com\/wp-content\/uploads\/active-link-highlight.mp4?_=1\" \/><a href=\"https:\/\/webdevtrick.com\/wp-content\/uploads\/active-link-highlight.mp4\">https:\/\/webdevtrick.com\/wp-content\/uploads\/active-link-highlight.mp4<\/a><\/video><\/div>\n<p>Now you can see this visually. If you like this one then get the <strong>source code<\/strong> of its.<\/p>\n<p><span style=\"font-size: 14pt;\">You May Also Like:<\/span><\/p>\n<ul>\n \t<span><\/p>\n<li><a href=\"https:\/\/webdevtrick.com\/newsletter-signup-form\/\" target=\"_blank\" rel=\"noopener noreferrer\">Animated Newsletter Signup Form With Validation<\/a><\/li>\n<li><a href=\"https:\/\/webdevtrick.com\/html-css-mode-change\/\" target=\"_blank\" rel=\"noopener noreferrer\">Dark And Light Mode Switch Using HTML CSS &amp; JS<\/a><\/li>\n<li><a href=\"https:\/\/webdevtrick.com\/html-css-javascript-calendar\/\" target=\"_blank\" rel=\"noopener noreferrer\">HTML CSS JavaScript Calendar<\/a><\/li>\n<li><a href=\"https:\/\/webdevtrick.com\/split-image-in-javascript\/\" target=\"_blank\" rel=\"noopener noreferrer\">Split An Image Using JavaScript<\/a><\/li>\n<li><a href=\"https:\/\/webdevtrick.com\/text-animate-on-scroll\/\" target=\"_blank\" rel=\"noopener noreferrer\">Text Divide &amp; Animate On Scroll<\/a><\/li>\n<p><\/span>\n<\/ul>\n<h2>Discussion About Active Link Indicator<\/h2>\n<p>Before <strong>sharing source code<\/strong>, Let&#8217;s talk about it. I created two sections one for creating a menu and other section for its page.\u00a0 I gave id on pages and add the id on menu&#8217;s action. For example, I put home pages ID is <code>id= \"home-id\"<\/code> and put on Home menu <code>&lt; a href=\"#home-id\"&gt;<\/code> . Now when you click home on the menu section then its automatically navigate to the home page.<\/p>\n<p>I used HTML Data attribute, The data-* attributes gives us the ability to embed custom data attributes on all HTML elements (more <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTML\/Global_attributes\/data-*\" target=\"_blank\" rel=\"noopener noreferrer\">Info<\/a>). In the menu section, we store data and give unique data id to every menu using data-tab-*. I created 7 menus I put A to G in data-tab, For example, <em>data-tab-A<\/em> for the first menu and <em>data-tab-B<\/em> for the second menu.<\/p>\n<p>Now in the page section, I used data attribute with <em>data-tab-panel<\/em> value<strong>.\u00a0<\/strong>In this section, I also used A to G alphabets. Then I choose the home menu and page to active by default by putting <code>data-active-tab=\"A\"<\/code>.\u00a0 In the CSS section, I put a line for a separate menu and pages. Between the menu and page section, I put the <span><a href=\"https:\/\/webdevtrick.com\/link-hover-effect-wordpress\/\" target=\"_blank\" rel=\"noopener noreferrer\">underline effect<\/a><\/span> to create the highlight.<\/p>\n<p>I put a span with 3px height with a color, It&#8217;s width is decided according to the menu&#8217;s words length using JavaScript. In the main section, I put <code>overflow-x: scroll;<\/code> and <code>overflow-y: hidden;<\/code> values, creating a scroll effect. Also I put <code>.main-options::-webkit-scrollbar { display: none; }<\/code> to hide scroll bar.<\/p>\n<p>In JavaScript Section, I put all controls of styling. I created variable for each section, Then it&#8217;s changed according to the environment. I create a loop to check the width of the menu&#8217;s words length and change it dynamically. There are many more commands, I can&#8217;t explain it in writing, After getting the codes you will understand automatically.<\/p>\n<h2>Highlight Current Page With HTML CSS JavaScript Source Code<\/h2>\n<p>For Creating This Program You Have to Create 3 files. First for <strong>HTML<\/strong>, second for<strong> CSS<\/strong>, and third for <strong>JavaScript<\/strong>. Follow the steps to creating this without any error.<\/p>\n<p><span style=\"font-size: 14pt;\">index.html<\/span><\/p>\n<p>Create an HTML file named &#8216;<strong><em>index.html<\/em><\/strong>&#8216; and put these codes given below.<\/p>\n<pre class=\"lang:xhtml decode:true\" title=\"index.html\">&lt;!DOCTYPE html&gt;\r\n&lt;!-- code by webdevtrick ( https:\/\/webdevtrick.com) --&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n  &lt;meta charset=\"UTF-8\"&gt;\r\n  &lt;title&gt;Active Link Indicator | Webdevtrick.com&lt;\/title&gt;\r\n  &lt;link href=\"https:\/\/fonts.googleapis.com\/css?family=Righteous&amp;display=swap\" rel=\"stylesheet\"&gt;\r\n      &lt;link rel=\"stylesheet\" href=\"style.css\"&gt;\r\n  \r\n&lt;\/head&gt;\r\n\r\n&lt;body&gt;\r\n\r\n&lt;section class=\"main-section\" data-active-tab=\"A\"&gt;\r\n\t\r\n  &lt;div class=\"main-options\"&gt;\r\n    \r\n    &lt;nav class=\"menus\"&gt;\r\n      &lt;a href=\"#home\" class=\"menus-link\" data-tab=\"A\"&gt;&lt;span&gt;Home&lt;\/span&gt;&lt;\/a&gt;\r\n      &lt;a href=\"#about\" class=\"menus-link\" data-tab=\"B\"&gt;&lt;span&gt;About&lt;\/span&gt;&lt;\/a&gt;\r\n      &lt;a href=\"#services\" class=\"menus-link\" data-tab=\"C\"&gt;&lt;span&gt;Services&lt;\/span&gt;&lt;\/a&gt;\r\n      &lt;a href=\"#portfolio\" class=\"menus-link\" data-tab=\"D\"&gt;&lt;span&gt;Portfolio&lt;\/span&gt;&lt;\/a&gt;\r\n      &lt;a href=\"#contact\" class=\"menus-link\" data-tab=\"E\"&gt;&lt;span&gt;Contact&lt;\/span&gt;&lt;\/a&gt;\r\n      &lt;a href=\"#faq\" class=\"menus-link\" data-tab=\"F\"&gt;&lt;span&gt;FAQ&lt;\/span&gt;&lt;\/a&gt;\r\n      &lt;a href=\"#donate\" class=\"menus-link\" data-tab=\"G\"&gt;&lt;span&gt;Donate&lt;\/span&gt;&lt;\/a&gt;\r\n      &lt;span class=\"undr-line\"&gt;&lt;\/span&gt;\r\n    &lt;\/nav&gt;\r\n  &lt;\/div&gt;\r\n\t\r\n  &lt;div class=\"section-list\"&gt;\r\n    &lt;div class=\"sections\" id=\"home\" data-tab-panel=\"A\"&gt;Home Section&lt;\/div&gt;\r\n    &lt;div class=\"sections\" id=\"about\" data-tab-panel=\"B\"&gt;About Section&lt;\/div&gt;\r\n    &lt;div class=\"sections\" id=\"services\" data-tab-panel=\"C\"&gt;Services Section&lt;\/div&gt;\r\n    &lt;div class=\"sections\" id=\"portfolio\" data-tab-panel=\"D\"&gt;Portfolio Section&lt;\/div&gt;\r\n    &lt;div class=\"sections\" id=\"contact\" data-tab-panel=\"E\"&gt;Contact Section&lt;\/div&gt;\r\n    &lt;div class=\"sections\" id=\"faq\" data-tab-panel=\"F\"&gt;FAQ Section&lt;\/div&gt;\r\n    &lt;div class=\"sections\" id=\"donate\" data-tab-panel=\"G\"&gt;Donate Section&lt;\/div&gt;\r\n  &lt;\/div&gt;\r\n&lt;\/section&gt;\r\n \r\n    &lt;script  src=\"function.js\"&gt;&lt;\/script&gt;\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><span style=\"font-size: 14pt;\">style.css<\/span><\/p>\n<p>Now create a CSS file named &#8216;<strong><em>style.css<\/em><\/strong>&#8216; and put these codes.<\/p>\n<pre class=\"lang:css decode:true \" title=\"style.css\">\/** code by webdevtrick ( https:\/\/webdevtrick.com) **\/\r\nbody {\r\n  box-sizing: border-box;\r\n  background-color: #F0F0F0;\r\n  height: 100vh;\r\n  overflow: hidden;\r\n  padding-top: 100px;\r\n  text-rendering: optimizeLegibility;\r\n  font-smoothing: antialiased;\r\n  font-family: 'Righteous', cursive;\r\n \r\n}\r\n\r\n.main-section {\r\n  width: 100%;\r\n  text-align: center;\r\n}\r\n\r\n.menus {\r\n  position: relative; \r\n  border-bottom: 1px solid #555;\r\n}\r\n\r\n.menus .menus-link {\r\n    display: inline-block;\r\n    margin: 0 16px;\r\n    text-decoration: none;\r\n    font-size: 20px;\r\n    line-height: calc(11px * 4);\r\n    color: #333;\r\n    text-transform: uppercase;\r\n  }\r\n\r\n.menus .menus-link span {\r\n      font-size: inherit;\r\n      line-height: inherit;\r\n      letter-spacing: 1px;\r\n    }\r\n\r\n.menus .undr-line {\r\n    position: absolute;\r\n    bottom: 0;\r\n    left: 0;\r\n    width: 100px;\r\n    height: 5px;\r\n    background-color: #FF4245;\r\n    transition-property: transform, left, background-color;\r\n    transition-duration: .2s;\r\n    transform-origin: 0;\r\n    transform: translate3d(0, 0, 0) scaleX(0);\r\n    opacity: 0;\r\n    animation: myanim .2s forwards;\r\n    animation-delay: .2s;\r\n  }\r\n\r\n.sections {\r\n  padding: 40px;\r\n  font-size: 26px;\r\n  color: #545454;\r\n  text-transform: uppercase;\r\n  letter-spacing: 1px;\r\n  display: none;\r\n}\r\n\r\n.main-options {\r\n  overflow-x: scroll;\r\n  overflow-y: hidden;\r\n  white-space: nowrap;\r\n}\r\n\r\n.main-options::-webkit-scrollbar {\r\n    display: none;\r\n    height: 0;\r\n    background-color: transparent;\r\n  }\r\n\r\n@keyframes myanim {\r\n  to {\r\n    opacity: 1;\r\n  }\r\n}\r\n\r\n<\/pre>\n<p><span style=\"font-size: 14pt;\">function.js<\/span><\/p>\n<p>The final step, Create a JavaScript file named &#8216;<strong><em>function.js<\/em><\/strong>&#8216; and put the codes.<\/p>\n<pre class=\"lang:js decode:true\" title=\"function.js\">\/** code by webdevtrick ( https:\/\/webdevtrick.com) **\/\r\nvar tabsModule = document.body.querySelector(\".main-section\");\r\nvar tabNavList = document.body.querySelector(\".menus\");\r\nvar tabNavLinks = document.querySelectorAll(\".menus-link\");\r\nvar tabNavCurrentLinkindicator = tabNavList.querySelector(\".undr-line\");\r\nvar tabPanels = document.querySelectorAll(\".sections\");\r\n\r\ndocument.getElementById(\"home\").style.display = \"block\";\r\n\r\n\r\nfunction positionIndicator() {\r\n  var tabNavListLeftPosition = tabNavList.getBoundingClientRect().left;\r\n  var tabsModuleSectionDataValue = tabsModule.getAttribute(\"data-active-tab\") || \"A\";\r\n  var tabNavCurrentLinkText = tabNavList.querySelector(\"[data-tab='\" + tabsModuleSectionDataValue + \"'] span\");\r\n  var tabNavCurrentLinkTextPosition = tabNavCurrentLinkText.getBoundingClientRect();\r\n  tabNavCurrentLinkindicator.style.transform =\r\n    \"translate3d(\" +\r\n    (tabNavCurrentLinkTextPosition.left - tabNavListLeftPosition) +\r\n    \"px,0,0) scaleX(\" +\r\n    tabNavCurrentLinkTextPosition.width * 0.01 +\r\n    \")\";\r\n}\r\n\r\npositionIndicator();\r\n\r\nfunction hideAllTabPanels() {\r\n  for (i = 0; i &lt; tabPanels.length; i++) {\r\n    tabPanels[i].removeAttribute(\"style\");\r\n  }\r\n};\r\n\r\nvar tabNavLinkEvent = function() {\r\n  var thisLink = this.getAttribute(\"data-tab\");\r\n  var thisHref = this.getAttribute(\"href\");\r\n  var thisTabPanel = document.querySelector(thisHref);\r\n  tabsModule.setAttribute(\"data-active-tab\", thisLink);\r\n  hideAllTabPanels();\r\n  thisTabPanel.style.display = \"block\";\r\n  positionIndicator();\r\n};\r\n\r\nfor (var i = 0; i &lt; tabNavLinks.length; i++) {\r\n  tabNavLinks[i].addEventListener(\"click\", tabNavLinkEvent, false);\r\n}\r\n\r\n(function() {\r\n  window.addEventListener(\"resize\", resizeThrottler, false);\r\n  var resizeTimeout;\r\n  function resizeThrottler() {\r\n    if (!resizeTimeout) {\r\n      resizeTimeout = setTimeout(function() {\r\n        resizeTimeout = null;\r\n        actualResizeHandler();\r\n      }, 66);\r\n    }\r\n  }\r\n  function actualResizeHandler() {\r\n    positionIndicator();\r\n  }\r\n})();<\/pre>\n<p>That&#8217;s It. Now you have successfully created <strong>Highlight Current Page Program With HTML CSS JavaScript<\/strong> ( JS ), <strong>Show Active Link, Menu, and Page<\/strong>. If you have any doubt or question comment down below.<\/p>\n<p><span style=\"font-family: impact, sans-serif;\">Thanks For Visiting, Keep Visiting.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How we can highlight the current page, menu, or link? We can do this with HTML CSS &amp; JavaScript. Check Out This Highlight Current Page With HTML CSS JS, Show Active Link Or Menu. I am sure that, You have seen underline on the current menu or page on mostly all websites. When we click [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1670,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[43,42,46,41],"tags":[222,94,74,146,221,155,68,54,67],"class_list":["post-1668","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-css","category-html","category-javascript","category-web-development","tag-active-page-indicate","tag-animate-text-underline","tag-css-animation","tag-css-menu","tag-current-menu-highlight","tag-html-and-css","tag-html-source-code","tag-menu","tag-source-code"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Highlight Current Page With HTML CSS JS | Show Active Link Or Menu<\/title>\n<meta name=\"description\" content=\"Want to Indicate current page, menu, or link? Check out this Highlight Current Page With HTML CSS JavaScript. Get Source Code Of Show Active Link Or Menu.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webdevtrick.com\/highlight-current-page\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Highlight Current Page With HTML CSS JS | Show Active Link Or Menu\" \/>\n<meta property=\"og:description\" content=\"Want to Indicate current page, menu, or link? Check out this Highlight Current Page With HTML CSS JavaScript. Get Source Code Of Show Active Link Or Menu.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webdevtrick.com\/highlight-current-page\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Dev Trick\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webdevtrick\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-06-15T18:00:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webdevtrick.com\/wp-content\/uploads\/current-page-highlight.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"629\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"shaan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"shaan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webdevtrick.com\/highlight-current-page\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webdevtrick.com\/highlight-current-page\/\"},\"author\":{\"name\":\"shaan\",\"@id\":\"https:\/\/webdevtrick.com\/#\/schema\/person\/c79bae83976f92fe305c22342b2a0be3\"},\"headline\":\"Highlight Current Page With HTML CSS JS | Show Active Link Or Menu\",\"datePublished\":\"2019-06-15T18:00:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webdevtrick.com\/highlight-current-page\/\"},\"wordCount\":752,\"commentCount\":10,\"publisher\":{\"@id\":\"https:\/\/webdevtrick.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/webdevtrick.com\/highlight-current-page\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webdevtrick.com\/wp-content\/uploads\/current-page-highlight.jpg\",\"keywords\":[\"active page indicate\",\"animate text underline\",\"css animation\",\"css menu\",\"current menu highlight\",\"html and css\",\"html source code\",\"menu\",\"source code\"],\"articleSection\":[\"CSS\",\"HTML\",\"JavaScript\",\"Web Development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webdevtrick.com\/highlight-current-page\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webdevtrick.com\/highlight-current-page\/\",\"url\":\"https:\/\/webdevtrick.com\/highlight-current-page\/\",\"name\":\"Highlight Current Page With HTML CSS JS | Show Active Link Or Menu\",\"isPartOf\":{\"@id\":\"https:\/\/webdevtrick.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webdevtrick.com\/highlight-current-page\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webdevtrick.com\/highlight-current-page\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webdevtrick.com\/wp-content\/uploads\/current-page-highlight.jpg\",\"datePublished\":\"2019-06-15T18:00:38+00:00\",\"description\":\"Want to Indicate current page, menu, or link? Check out this Highlight Current Page With HTML CSS JavaScript. Get Source Code Of Show Active Link Or Menu.\",\"breadcrumb\":{\"@id\":\"https:\/\/webdevtrick.com\/highlight-current-page\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webdevtrick.com\/highlight-current-page\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webdevtrick.com\/highlight-current-page\/#primaryimage\",\"url\":\"https:\/\/webdevtrick.com\/wp-content\/uploads\/current-page-highlight.jpg\",\"contentUrl\":\"https:\/\/webdevtrick.com\/wp-content\/uploads\/current-page-highlight.jpg\",\"width\":1200,\"height\":629,\"caption\":\"highlight current page\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webdevtrick.com\/highlight-current-page\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webdevtrick.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Highlight Current Page With HTML CSS JS | Show Active Link Or Menu\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webdevtrick.com\/#website\",\"url\":\"https:\/\/webdevtrick.com\/\",\"name\":\"Web Dev Trick\",\"description\":\"HTML5, CSS3, JS, PHP Source Code &amp; Tutorial\",\"publisher\":{\"@id\":\"https:\/\/webdevtrick.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webdevtrick.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webdevtrick.com\/#organization\",\"name\":\"Web Dev Trick\",\"url\":\"https:\/\/webdevtrick.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webdevtrick.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/webdevtrick.com\/wp-content\/uploads\/logo-fb-1.png\",\"contentUrl\":\"https:\/\/webdevtrick.com\/wp-content\/uploads\/logo-fb-1.png\",\"width\":512,\"height\":512,\"caption\":\"Web Dev Trick\"},\"image\":{\"@id\":\"https:\/\/webdevtrick.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webdevtrick\/\",\"https:\/\/pinterest.com\/webdevtrick\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webdevtrick.com\/#\/schema\/person\/c79bae83976f92fe305c22342b2a0be3\",\"name\":\"shaan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webdevtrick.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/60aa6ee93605bda7bc598d11dd748709a69bdb55a080124cc382114d8d7e7665?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/60aa6ee93605bda7bc598d11dd748709a69bdb55a080124cc382114d8d7e7665?s=96&d=mm&r=g\",\"caption\":\"shaan\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Highlight Current Page With HTML CSS JS | Show Active Link Or Menu","description":"Want to Indicate current page, menu, or link? Check out this Highlight Current Page With HTML CSS JavaScript. Get Source Code Of Show Active Link Or Menu.","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:\/\/webdevtrick.com\/highlight-current-page\/","og_locale":"en_US","og_type":"article","og_title":"Highlight Current Page With HTML CSS JS | Show Active Link Or Menu","og_description":"Want to Indicate current page, menu, or link? Check out this Highlight Current Page With HTML CSS JavaScript. Get Source Code Of Show Active Link Or Menu.","og_url":"https:\/\/webdevtrick.com\/highlight-current-page\/","og_site_name":"Web Dev Trick","article_publisher":"https:\/\/www.facebook.com\/webdevtrick\/","article_published_time":"2019-06-15T18:00:38+00:00","og_image":[{"width":1200,"height":629,"url":"https:\/\/webdevtrick.com\/wp-content\/uploads\/current-page-highlight.jpg","type":"image\/jpeg"}],"author":"shaan","twitter_card":"summary_large_image","twitter_misc":{"Written by":"shaan","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webdevtrick.com\/highlight-current-page\/#article","isPartOf":{"@id":"https:\/\/webdevtrick.com\/highlight-current-page\/"},"author":{"name":"shaan","@id":"https:\/\/webdevtrick.com\/#\/schema\/person\/c79bae83976f92fe305c22342b2a0be3"},"headline":"Highlight Current Page With HTML CSS JS | Show Active Link Or Menu","datePublished":"2019-06-15T18:00:38+00:00","mainEntityOfPage":{"@id":"https:\/\/webdevtrick.com\/highlight-current-page\/"},"wordCount":752,"commentCount":10,"publisher":{"@id":"https:\/\/webdevtrick.com\/#organization"},"image":{"@id":"https:\/\/webdevtrick.com\/highlight-current-page\/#primaryimage"},"thumbnailUrl":"https:\/\/webdevtrick.com\/wp-content\/uploads\/current-page-highlight.jpg","keywords":["active page indicate","animate text underline","css animation","css menu","current menu highlight","html and css","html source code","menu","source code"],"articleSection":["CSS","HTML","JavaScript","Web Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webdevtrick.com\/highlight-current-page\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webdevtrick.com\/highlight-current-page\/","url":"https:\/\/webdevtrick.com\/highlight-current-page\/","name":"Highlight Current Page With HTML CSS JS | Show Active Link Or Menu","isPartOf":{"@id":"https:\/\/webdevtrick.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webdevtrick.com\/highlight-current-page\/#primaryimage"},"image":{"@id":"https:\/\/webdevtrick.com\/highlight-current-page\/#primaryimage"},"thumbnailUrl":"https:\/\/webdevtrick.com\/wp-content\/uploads\/current-page-highlight.jpg","datePublished":"2019-06-15T18:00:38+00:00","description":"Want to Indicate current page, menu, or link? Check out this Highlight Current Page With HTML CSS JavaScript. Get Source Code Of Show Active Link Or Menu.","breadcrumb":{"@id":"https:\/\/webdevtrick.com\/highlight-current-page\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webdevtrick.com\/highlight-current-page\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webdevtrick.com\/highlight-current-page\/#primaryimage","url":"https:\/\/webdevtrick.com\/wp-content\/uploads\/current-page-highlight.jpg","contentUrl":"https:\/\/webdevtrick.com\/wp-content\/uploads\/current-page-highlight.jpg","width":1200,"height":629,"caption":"highlight current page"},{"@type":"BreadcrumbList","@id":"https:\/\/webdevtrick.com\/highlight-current-page\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webdevtrick.com\/"},{"@type":"ListItem","position":2,"name":"Highlight Current Page With HTML CSS JS | Show Active Link Or Menu"}]},{"@type":"WebSite","@id":"https:\/\/webdevtrick.com\/#website","url":"https:\/\/webdevtrick.com\/","name":"Web Dev Trick","description":"HTML5, CSS3, JS, PHP Source Code &amp; Tutorial","publisher":{"@id":"https:\/\/webdevtrick.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webdevtrick.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webdevtrick.com\/#organization","name":"Web Dev Trick","url":"https:\/\/webdevtrick.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webdevtrick.com\/#\/schema\/logo\/image\/","url":"https:\/\/webdevtrick.com\/wp-content\/uploads\/logo-fb-1.png","contentUrl":"https:\/\/webdevtrick.com\/wp-content\/uploads\/logo-fb-1.png","width":512,"height":512,"caption":"Web Dev Trick"},"image":{"@id":"https:\/\/webdevtrick.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webdevtrick\/","https:\/\/pinterest.com\/webdevtrick\/"]},{"@type":"Person","@id":"https:\/\/webdevtrick.com\/#\/schema\/person\/c79bae83976f92fe305c22342b2a0be3","name":"shaan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webdevtrick.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/60aa6ee93605bda7bc598d11dd748709a69bdb55a080124cc382114d8d7e7665?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/60aa6ee93605bda7bc598d11dd748709a69bdb55a080124cc382114d8d7e7665?s=96&d=mm&r=g","caption":"shaan"}}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webdevtrick.com\/wp-json\/wp\/v2\/posts\/1668","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webdevtrick.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webdevtrick.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webdevtrick.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/webdevtrick.com\/wp-json\/wp\/v2\/comments?post=1668"}],"version-history":[{"count":0,"href":"https:\/\/webdevtrick.com\/wp-json\/wp\/v2\/posts\/1668\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webdevtrick.com\/wp-json\/wp\/v2\/media\/1670"}],"wp:attachment":[{"href":"https:\/\/webdevtrick.com\/wp-json\/wp\/v2\/media?parent=1668"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webdevtrick.com\/wp-json\/wp\/v2\/categories?post=1668"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webdevtrick.com\/wp-json\/wp\/v2\/tags?post=1668"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}