HTML/CSS - Buttons - When to use what

Viewed 6186

I have a pretty basic question regarding buttons on HTML pages.

As we know, there are several possibilities to create them. It is possible to set display: block; on an a, so one can assign a color, width and height to it. But there is also the HTML element button and the element submit.

When to use what? For example, when creating a form, I need a submit element if I remember right. But when I have a button outside of a form, I can use a normal a. But still, I don't know then to use button.

Could you please help me out with this?

5 Answers
Related