1

Ok, here's the thing. I've done a webpage which contains forms and so I added buttons as elements and this works great. I created their own css classes and use graphics as background images for each of them. All working great (these are submit buttons btw)

Anyway, I've also got a jQuery script from before that takes all a href hyperlinks and add content from a set div from an external file and adds to a div in my current page, all in one animation. But this would probably not work with form buttons?

In any case I need to be able to have these buttons work as traditional hyperlinks anyway. So what do I do?

I thought about using css-buttons alltogether, but I'm not able to have them stack vertically. Using float left or right just put the buttons outside of their parent containers (probably a different fix for that).

But in any case, using css buttons, that wouldn't work as a submit button for the forms anyway would it? Should I perhaps use both form buttons and css buttons? What do you do?

1 Answer 1

6

<button> elements.

You should never use links to submit data, users with javascript disabled won't be able to use them, crawlers can submit data accidentally, etc...

Sign up to request clarification or add additional context in comments.

8 Comments

thanks for the edit meagar, didn't know how to do that inline code :)
No worries, I had hoped you'd pick up on it :)
Another reason for using a <button> is that it works better with assistive technologies like screen readers.
In conclusion, both <button> elements and CSS-buttons are what I really want then? Each for their own purpose? What are the differences between <button> and <input> anyway? Should I use button specifically?
If your button submits user supplied data use a button, if it doesn't use href.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.