I know, the official twitter developer site tells about all of the following features, however I needed to create a custom tweet button, not the one labelled as 'Tweet'.
So here are the steps:
First include this code in your website:
Create a link, something like
Change the URL to this: http://twitter.com/intent/tweet
Add some extra parameters, if you want to have a default text, or if you want to tag someone or add hashtags, a link (the parameters has to be url-encoded, but as I found, most of the browsers does it instead of us):
text - default text of tweet
url - link (it will be shortened)
via - tag someone
hashtags - add hashtags to the tweet (you have to separate them with commas)
in_reply_to - replies to a tweet. You have to provide the tweet's id
So here are some example links:
You can show an image instead of Tweet this, just replace it the code:
And the result:

If you want to copy the code to multiple pages, here is a small javascript code that replaces the link url to the current page: