How to make the first point go too?

  • 0
    href with #block works ( href = "# block" )

    and there is no href with a slash href = "/ # about" )
    https://jsfiddle.net/up2ycgfe/
    JavaScript Anonymous, Jun 29, 2019

  • 2 Answers
  • 0
    1. Because there are two types of links - relative and absolute. Absolute paths contain the full path, starting with the protocol, for example
    <a href="http://site.ru">Кому-то пора почитать про азы HTML</a>


    2. Because there is such a tag & lt; base href = "/" & gt; , which is used when you specify relative links and helps to form the full path.

    For example, it is specified like this:

    & lt; base href = "http://site.ru" / & gt;



    Then for the link
    <a href="/#about">Кому-то пора почитать про азы HTML</a>
    the full path will be site.ru/#about , that is, in this case, the anchor will be searched for on the main page, and not on the one where the link is located
    Anonymous

  • 0
    In an eerie-scary form (I couldn't think of it better):

    Abigail Long

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!