Home > Blockchain >  How to make links crawlable in a responsive menu on a webpage?
How to make links crawlable in a responsive menu on a webpage?

Time:12-17

When I create a responsive menu on a webpage according to the really nice template here: https://www.w3schools.com/howto/howto_js_topnav_responsive.asp google lighthouse claims that the links are not crawlable.

How can I make the links crawlable

CodePudding user response:

The links in that example are not crawlable because they are either fragment identifier links (#contact) or JavaScript links (javascript:void(0);). It has nothing to do with the responsiveness of the menu or any of the CSS involved.

To make the menu crawlable replace the links with links to HTML documents on your site. For example:

<a href="/contact.html">Contact</a>

CodePudding user response:

So, while I did not find out whether this is actually a weakness of the lighthouse, I did find an example which shows how the responsive menu can be done without this error:

https://codecary.com/responsive-navigation-menu-bar-in-html-css/

When putting the example code in this place on a webserver, lighthouse will find all links crawlable.

  • Related