Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJacob Thomson
757 PointsHTML
Looking back at my work space, I'm wondering why he used a ul and li tags to create the buttons? Why wouldn't he use button tags?
1 Answer
Matthew Greenberg
8,173 PointsThe button tag is reserved for forms and form like input.
We use UL, LI, and A tags for creating buttons that link around our page.
Buttons don't have a native way to direct you to another page, you would have use php or javascript or some other language in addition to your html to get a button to do what an A tag already does with the href attribute.
Jacob Thomson
757 PointsJacob Thomson
757 PointsThanks for clarifying Mathew, I'm currently developing a website as we speak. It is a single page website, the design has buttons throughout, but i only want the button to direct you to the desired spot on the page. I'm using the <button> tag because it looks more like the design if you know what i mean? What tag would be most effective for this? I also need to add style to match the design. Matthew Greenberg
Matthew Greenberg
8,173 PointsMatthew Greenberg
8,173 PointsIf your jumping around the page you would still want to you the A tag with an href attribute. For example
This will jump directly to the bottom of the page, If you want to animate a scroll, you have to use javascript. Hope this helps.
Jacob Thomson
757 PointsJacob Thomson
757 PointsI finally understand! Thank you, Matthew Greenberg