It happens because you have two same ID's on the page. You cannot do that, it is a HTML error. How do you want to do this is like this. Create a section and give it an ID, then create a mobile section under it and leave it with no ID. On desktop the menu click will scroll the page to the id and on mobile when the desktop version is hidden, the menu click will scroll to the same location. It is because the ID is still in the HTML but it is hidden with CSS. I hope you understood me
Comments
How do you want to do this is like this.
Create a section and give it an ID, then create a mobile section under it and leave it with no ID.
On desktop the menu click will scroll the page to the id and on mobile when the desktop version is hidden, the menu click will scroll to the same location. It is because the ID is still in the HTML but it is hidden with CSS. I hope you understood me