I hope someone can help me with the following. I am trying to build a basic point and click game, not many moving parts besides linking several pages together for navigation. Running into this issue when linking my first button to the a page I just built for the link.
Clicking the button works great, does what I need it to do, displays the right page and stylesheet. But when I make the anchor tag around that button, it changes my buttons width to 1/3 of what I have it set to, and it eliminates any buttons I have in the code below the line I am trying to link.
I have been trying to google a solution, but I don’t see anyone having a similar issue like this. I looked at a few videos of people adding anchor tags to buttons, I basically copy what they are doing, but their preview window doesn’t change, mine does. I am at a standstill yet again until I figure this one out…
Thanks in advance for anyone who can shed some light…
If it links to a URL it is a link, not a button. It doesn’t matter what it looks like.
You can just style the links however you want. They can look like buttons and use the same styles as your other buttons.
I would however suggest you make sure the user can identify links as links and not make them look the same as buttons that are not links. Otherwise, it can be confusing UX.
It is also possible to use JS to make buttons open links but that is not a great idea.
Hmm. Thank you for all your info. I am having a hard time understanding what the common way to do this is. For example, the below picture. So that is not a button, but instead a link?
I am basically trying to make buttons just like that so when you press the ‘mining’ button it brings you to the mining page where you can select which ore you would like to mine.
However, it is not uncommon for a page to use JS for something that looks like navigation. For example, a single-page app might use a button to trigger something that looks like navigation but is just a DOM update.
You must not be using the class correctly. The .start-btn class needs to be used as the selector and added to the a element. Or you are not linking to the stylesheet correctly.
I have no way of knowing what is wrong just from that image.