Navigation | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Navigation

How can I navigate on my page. Example when you press ā€œloginā€ you are navigated to another place on the page. Can someone please learn me how to do that? Iā€™m struggling with my page. Itā€™s called Bnak3 if you want to see it. Any ways I wanna create a button that takes you to another place on the pages like if you press ā€œloginā€ Thank you. Btw if i misspelt something please tell cause Iā€™m a Dane and Iā€™m also learning English right now. So just tell me if I made any mistake Thank You.

7th Oct 2018, 8:51 AM
Alexander R. Storr-Hansen
Alexander R. Storr-Hansen - avatar
7 Answers
+ 3
Providing link to Bnak3 project for the benefit of those reading this thread: https://code.sololearn.com/WXKj6mH7dOTj/?ref=app Thus far, there doesn't seem to be a login button, so if you just want something that takes you to another spot on the same page, you can style an anchor to look like a button. Referencing the "HTML Links - Create a Bookmark" section: https://www.w3schools.com/html/html_links.asp (I think referring to them as "bookmarks" can be a bit misleading, but anyway...) Down the road, you will want to learn a back end language so you have a way to store the user information in a database (and all the other things you would expect from being able to create an account), but that can wait until after you have a solid foundation in the basics.
7th Oct 2018, 10:20 AM
Janningā­
Janningā­ - avatar
+ 2
The anchor tag is more generally used to retrieve an external document (i.e. a separate file). For it to work in the Code Playground, the separate file needs to be hosted (i.e. not another Code Playground project unless you don't mind it jumping to the code instead of the content directly and the Code Playground doesn't support multiple files in the same project). With JavaScript, you can write an onclick event listener to call a function (that presumably would start the game or whatever), but I would recommend finishing the CSS course and taking the JavaScript tutorial first.
7th Oct 2018, 10:46 AM
Janningā­
Janningā­ - avatar
+ 2
Happy to help. šŸ™‚
7th Oct 2018, 11:05 AM
Janningā­
Janningā­ - avatar
+ 1
Thank you. i apreciate it. i will finish my css course and start a Java course after that. Thank you again :)
7th Oct 2018, 10:51 AM
Alexander R. Storr-Hansen
Alexander R. Storr-Hansen - avatar
0
Ok
7th Oct 2018, 10:26 AM
Alexander R. Storr-Hansen
Alexander R. Storr-Hansen - avatar
0
Ok but how can i then make a button that takes me to another document or do something on the page. exemple you are in a game and press ā€œStartā€. it takes you to the actual game.
7th Oct 2018, 10:29 AM
Alexander R. Storr-Hansen
Alexander R. Storr-Hansen - avatar
0
šŸ‘
7th Oct 2018, 11:32 AM
Alexander R. Storr-Hansen
Alexander R. Storr-Hansen - avatar