How to make the first point go too?
-
href with #block works (
href = "# block"
)
and there is no href with a slashhref = "/ # about"
)
https://jsfiddle.net/up2ycgfe/JavaScript Anonymous, Jun 29, 2019 -
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
the full path will be site.ru/#about i>, 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<a href="/#about">Кому-то пора почитать про азы HTML</a>
Anonymous -
In an eerie-scary form (I couldn't think of it better):
Abigail Long
2 Answers
Your Answer
To place the code, please use CodePen or similar tool. Thanks you!