How to add button on html? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to add button on html?

html nav button hello I have a question abou html. how to create a button from nav that when you click it bring you to a section of the same page ?

7th May 2020, 12:19 PM
zinwar zardasht
zinwar zardasht - avatar
2 Answers
+ 9
There comes id attribute and href attribute to play. You can have multiple section in one page, and at the top you have multiple link. <a href="#sec1">section 1</a> <a href="#sec2">section 2</a> <a href="#sec3">section 3</a> Now you have different sections Make sure you use same id as you used up there. <div id="sec1"></div> <div id="sec2"></div> <div id="sec3"></div> That's it, when someone clicks on that links it will bring them to respective section
7th May 2020, 12:28 PM
Raj Chhatrala
Raj Chhatrala - avatar
0
<button>
18th Jan 2022, 6:13 PM
Chris
Chris - avatar