HTML Anchor Tag | How to Link to a Section of the Page | Know 10 things about HTML Anchor | Course
Вставка
- Опубліковано 16 гру 2021
- Learn How to Link to a Section of a Web Page.
Important Links:
- GitHub: github.com/atapas/anchors
- Anchors app: anchors.vercel.app/
Sir one question when i use class instead of id it cannot work why? And also id and class is same or different?
Id and class are different. Id is unique to a page where the class can be repeated.
It is meant to work only with ID as ID can be identified with # and it is unique. As class can be duplicated, it will be confusing which section to go to.
Will the url be updated when the user scrolls down?
No, not by default. We need to use browser history API for it.
@@tapasadhikary can you give me more details about it? Thank you
unsaon pag tapad