Tuesday 17 October 2017

html - Image for a submit button - which way is best?

style="font-weight: bold;">

Answer



style="font-weight: bold;">

Answer







In order to
use an image as a form's submit button, I have come across two ways and would like to
know which one is correct/best-practice.



Version
1:



            type="submit">
Submit />



Version
2:




            type="image" src="mybutton.jpg" border="0" alt="Submit"
/>


I personally
feel that the first version is better because it makes semantic sense and has a type of
"submit". In the second version its saying the input is of type "image" which doesn't
mean much to me as a human.



Which one should I
go with?



Answer




Personally I would set it as a background
rather than an image inside the button. So you would get the
following.




            type="submit"
class="styledButton>




No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...