
But through this post, you will learn that the task of adding an HTML button is as simple as inserting a hyperlink !
First have a look at the button below:
If you want to place a button similar to that, then simply copy and paste this code
<form action="http://www.google.com" target="_blank" method="GET">Change the code in RED, as per your requirement !
<input type="submit" value="Google">
</form>
You can delete target="_blank" from the first line, if you want the new page to open in the same window, and if you want that the new page should open in a new window/tab then leave the target="_blank" as it is !
The button explained above is a "submit" type button, there are many other types too, like text, radio, check boxes etc.
You can read it in a bit more detail from here: W3Schools.com
As requested by Ankit, here's an update to this trick, through which you can use a custom button.
But this will need more work from your side, as it does not only depends on the code, but also on the graphics. That means you have to create two buttons, with exactly the same dimensions, one as Button_Up and one as Button_Down (when cursor is on the button).
Here's the button:
I have used these two images:
IMAGE 1:
IMAGE 2:
But this will need more work from your side, as it does not only depends on the code, but also on the graphics. That means you have to create two buttons, with exactly the same dimensions, one as Button_Up and one as Button_Down (when cursor is on the button).
Here's the button:
I have used these two images:
IMAGE 1:

IMAGE 2:

And the code to be used is this:
<a href="http://bloggerstop.net"><img src="IMAGE1" onmouseover="this.src='IMAGE2'" onmouseout="this.src='IMAGE1'" alt="Click Me"/></a>Although this method is quite slow in loading the second image, but this method is easier for most of the users. Moreover the other methods use CSS coding / JavaScript, due to which for every type of image, you have to add a different code in the blog template, which can slow down your whole blog...
43 comments
Write commentsNice Tip !! Must say...Nice Site !!!
Replyi like your blog ....
Reply;;) liked it
ReplyIf I want to place my own designed button ....then?
ReplyHi Ankit
ReplySee the update in the post !
Thanks !!
ReplyHowdy,
ReplyI was wondering if the rollover effect works if I don't have my own domain name (example:- http://something.blogspot.com. If i add the mouseover code then where do I host the images? The code you have given has image1 and image2. How do I install this code if my images are hosted on photobucket?
I truly appreciate your help on this matter!
Thanks in advance,
Chetan
Hi Chetan,
ReplyGo to gigaimage.com,
upload any two images from your PC, copy the two DIRECT LINKS to these images,
Now in place of IMAGE1 and IMAGE2 in the code above, paste the DIRECT LINKS, that's it, save the widget !
Thanks for your quick help.
ReplyYou R AWESOME!!!
thanks
Reply!! following ur page now!:)
Thanks Pulkit for following, you are always welcome on this blog !
ReplyRegards
Sai
Thank you so much! You helped me create a link to my music on iTunes!
Reply: )
I glad that it was useful to you...thanks for commenting....
ReplyRegards
Sai
that's Awesome nice post
ReplySir How to get >>Enter Your Email Address<<
Reply>>Subscribe<<
Button on
My Mail ID: lakshmohan92@gmail.com
ReplyPlease help me
Join Feedburner.com and get the embed code for your blog, that's it !
Replyfinally the one I'm looking for!!! thankss.. i'm bookmarking this site! keep it up!!
ReplyHi! I was curious how to insert a image size into this code? I put it on my site (which, by the way, it the only code I've found on the web that actually works for me!) and it's HUGE! I want to put the image size in there somewhere. Thanks! My email is amandabolton80@yahoo.com.
ReplyHi Amanda,
Replyput the height and width dimensions inside the img tag, like this:
<img height="x" width="y" src="IMAGE1"
where x and y are height and width in pixels.
I mean the two image code...thanks!
Replyoooh! thanks! I will try it now!
Replythank you so very much! It worked perfectly!
Replyok so total beginner ... got this to work, but how do i keep the buttons on one line and not above each other?
Replythis kind of helps, but not exactly what i was looking for. thanks though!
ReplySo what exactly is Kenzy looking for? :-/
ReplyFirst of all: thanx for al the advise. I'm trying to create a website and want to use the button. I'd like to create a button list.
ReplyHowever the buttons don't have a fixed with. As you can see here: www.rokenengezondheid.nl/p/gevolg.html
Is there a way to make al the buttons the same size, no matter de text they contain?
@Madijkie
ReplyIn the input tag, add a style-width attribute, like this:
<input style="width:200px;" type="submit" value="Google" />
& use the same value for all the buttons.
And, it would be better, if you use center tags around each button to keep their alignment centered, like this:
<div style="text-align: center;">
<form....
...
...
</form>
</div>
Thanx. That did the job!
ReplyHi Diya! this code rocks! it works flawlessly. I have a question:I want to use several of this codes in "one" widget to make a menu.I mean, repeat the whole code just changing the images and source. My problems is this, when I get all the sections of code, one below the other, the images don't rollover. They appear and redirect if I click on them but there is no image rollover. Is there any code I have to put between one piece of code and the other? or maybe this can't be done and only one of this hmtl code can live inside one widget.
Reply@Pepua
ReplyIf you want to add a menu to your blog, with rollover effect, then I would better suggest these menus to you. In these widgets, change background colors to background images.
Menu #1
Menu #2
If you want these menus to behave like simple-buttons, then do not use that drop down menu items, and let it all display in a single level.
Nice tutorial
Replycan you tell me how to make two buttons inline inside table.
OMG I'm going to kill someone XD this is the 100th site I been to or more looking how to make buttons for you blogger. I want more of a Navbar like you have on top but I would rather have it in my header under a Html gadget instead of putting it in my html script. I did have one in there but someone messed it up now I have to get another one and its stressing.
ReplyThen you should search properly for it, they are not simple html buttons. They are called html-drop-down-menus. Search for "drop down menus" in this blog, and you'll see a hell lot of them.
ReplyDivya Sai is The BEST.
ReplyThank you buddy :)
Replybut why anonymous?
this rollover combined with the preload trick I learned at this guy's blog (not affiliated with me otherthan I used it) makes your rollover a knockout.
Replyhttp://www.createblog.com/html_css-scripts/2417-preload-with-only-htmlcss/
how do I add a blogger button to my website?? so you can click on it and it will take you to my blog. Could you help me?
ReplyYou want to place a button on your blog, that will take visitors to your own blog?
ReplyHey, great piece of simple code, Im sure everyone looked for a while like i did before they found it and then loved it. I am starting out and am having a little trouble. mine rollover once but then stay ont he second image are you able to help? you can email me at luke@quedesign.com.au.
ReplyGreat site thanks heaps
Could I add 'mouseclick' image too ?
ReplyHello divya nice tutorial im looking for this since last week.
ReplyIt works for me but i need to put it on my blog template intact, i I mean adding that code without putting it on my
HTML/JavaScript widget.
Help plz! this my blog http://pctionary.blogspot.com/
thank you for the code! Its the only thing that works, seriously!
ReplyComments are moderated on this blog
Allowed HTML tags: <b>, <i> and <a>
Comment Like This! and Optimize your blog EmoticonEmoticon