Search code examples
htmlurlhref

How to link between url "domain.com/abc" to "domain.com/cde" using relative url?


How do I go from http://run.plnkr.co/jfGlh6QrAx48S4lZ/#!/main to http://run.plnkr.co/jfGlh6QrAx48S4lZ/#!/services using tag?

I tried through the following: <a href="#/services"> but its not working it is going to http://run.plnkr.co/jfGlh6QrAx48S4lZ/#!/main#%2Fservices


Solution

  • You should use

    <a href="#!/services">
    

    The link that starts with the hash (#) will keep the same URL you currently view and only change the hash part (the # and everything after it).