What are the pitfalls and advantages of doing the following for submit elements?
<!doctype html>
<style>
label input{display:none}
label span{background:blue;border:1px solid black;color:white;padding:4px;}
</style>
<form action=#>
<label>
<span>Submit</span>
<input type=submit value=Submit name=Submit>
</label>
</form>
add an example jsbin.com/onabo4.
Supposedly IE and a few other browser have input submit styling problems. Is the above a good solution? Adding overflow:auto
fixes IE browser rendering issues, unless you are inside a table. Is the above a good solution?
What are other issue might the above code solve?
EDIT: This appears to also solve the display:block issue for input elements, provided you want an input of type=sumbit. The issue is explained here: input with display:block is not a block, why not?
EDIT 2: For code purists and cross browser support I advise doing the following: The onclick is probably optional but some browser may not support label elements. The tabindex is to allow the user to be able to tab element. Basically tabindex adds keyboard friendliness.
<!doctype html>
<style>
.type-submit input{display:none;}
.type-submit{background:pink /* more pretty styles.... */}
</style>
<label onclick=this.form.submit() tabindex class=type-submit>
Sumbit<input type=submit>
</label>