{"id":7495,"date":"2010-05-21T22:30:38","date_gmt":"2010-05-21T14:30:38","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=7495"},"modified":"2025-04-04T00:41:21","modified_gmt":"2025-04-03T16:41:21","slug":"simple-call-to-action-button-with-css-jquery","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/simple-call-to-action-button-with-css-jquery\/","title":{"rendered":"Simple &quot;Call To Action&quot; Button With CSS &amp; jQuery"},"content":{"rendered":"<p><strong>Call to action<\/strong> in web design is a term used for elements in a web page that solicit an action from the user (clicking, hovering, etc). Today we\u2019re going to <strong>create an effective and awesome call to action button with some CSS and jQuery<\/strong> that grab the user\u2019s attention and entice him to click .<\/p>\n<p>Throughout this tutorial we\u2019ll explain every line of used code with details and hope it will be useful for you. The following tutorial uses <strong><em>HTML, CSS and jQuery<\/em><\/strong> with difficulty level <strong><em>Beginner<\/em><\/strong> and an estimated completion time of <strong><em>45 minutes<\/em><\/strong><em>.<\/em><\/p>\n<p><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/assets.hongkiat.com\/uploads\/call2action_button_tuts\/downloads\/call2action_tut.zip\" class=\"button-big\">Download Tutorial (.zip)<\/a> <em>or<\/em> <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/assets.hongkiat.com\/uploads\/call2action_button_tuts\/demo\/index.html\" class=\"button-big\">Demo<\/a><\/p>\n<h2>Part I \u2013 Create The Button Image<\/h2>\n<p>In this first part we will show you how to create the needed images with Photoshop in simple easy steps. Let\u2019s start.<\/p>\n<p><strong>Create a new Photoshop document<\/strong> with a width of 580px and a height of 130px. Go to <strong>View<\/strong> &gt; <strong>New Guide<\/strong> then, set the <strong>Orientation<\/strong> to <strong>Horizontal<\/strong> and the <strong>Position<\/strong> to 65px.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/call2action_button_tuts\/set-new-guide.jpg\" width=\"600\" height=\"256\"><\/figure>\n<p><strong>Create more guides<\/strong>; each for the top, bottom, left and right. Your image should have these following guides once you are done:<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/call2action_button_tuts\/all-guides.jpg\" width=\"600\" height=\"319\"><\/figure>\n<p>The guides appear to split your canvas into top and bottom halves. Select the <strong>Rounded Rectangular Tool<\/strong>, set the <strong>Radius<\/strong> to 5px and draw a rectangular shape on the top half of the canvas.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/call2action_button_tuts\/draw-first-rectangular.jpg\" width=\"600\" height=\"349\"><\/figure>\n<p>Change the Styles for <strong>Gradient Overlay<\/strong> and <strong>Stroke<\/strong>.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/call2action_button_tuts\/box1-gradient-overlay.jpg\" width=\"600\" height=\"474\"><\/figure>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/call2action_button_tuts\/box1-stroke.jpg\" width=\"600\" height=\"474\"><\/figure>\n<p>Select the <strong>Type<\/strong> Tool and type \u201c<em>Download<\/em>\u201d for as sample text into the box that you have created. Align the text to the center middle of the box and your output should look something like this:<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/call2action_button_tuts\/first-download-button.jpg\" width=\"600\" height=\"349\"><\/figure>\n<p>We finished the creation of the first state of the download button. Let\u2019s <strong>create a new group<\/strong> and move all layers into it. <strong>Duplicate the group<\/strong> and then position it under the first group. we\u2019ve created.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/call2action_button_tuts\/duplicate-group.jpg\" width=\"233\" height=\"174\"><\/figure>\n<p>Head over to the duplicated group and change the <strong>Gradient Overlay<\/strong> and <strong>Stroke<\/strong> style of the our second rectangular box (the hovered one) with the following setttings:<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/call2action_button_tuts\/box1-hover-gradient-overlay-.jpg\" width=\"600\" height=\"474\"><\/figure>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/call2action_button_tuts\/box1-hover-stroke.jpg\" width=\"600\" height=\"474\"><\/figure>\n<p>With the second group selected, use <strong>Move<\/strong> tool to move the entire rectangular box down to the second half of the canvas.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/call2action_button_tuts\/both-download-box.jpg\" width=\"600\" height=\"349\"><\/figure>\n<p>That\u2019s it! We finished with the first part. Save your image as <em><strong>download.png<\/strong><\/em> and fire up your favorite code editor.<\/p>\n<p><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/assets.hongkiat.com\/uploads\/call2action_button_tuts\/downloads\/button.psd\" class=\"button-big\">Download PSD<\/a><\/p>\n<h2>Part II \u2013 The HTML<\/h2>\n<h3>Step 1 \u2013 Prepare the necessary Files<\/h3>\n<p>Create a folder, and give it a name. We\u2019ll name it <strong>jQueryCallToaction<\/strong> for this tutorial. Inside <strong>jQueryCallToaction<\/strong> folder, create these following files\/ folders:<\/p>\n<ol>\n<ol>\n<li>Blank HTML file, <code>index.html<\/code><\/li>\n<li>Blank CSS file, <code>style.css<\/code><\/li>\n<li>Blank JavaScript file, <code>script.js<\/code><\/li>\n<li>Folder, named \"<strong>images<\/strong>\"<\/li>\n<li>Place <em>download.png<\/em> inside <strong>images<\/strong> folder.<\/li>\n<\/ol>\n<\/ol>\n<h3>Step 2 \u2013 Link <code>index.html<\/code> with CSS & JS<\/h3>\n<p>Let\u2019s link our <strong>CSS<\/strong> and <strong>JavaScript<\/strong> to <code>index.html<\/code>. Place them inside <code>&lt;head&gt;&lt;\/head&gt;<\/code>. We begin with the <strong>CSS file<\/strong>:<\/p>\n<pre>&lt;link href=\"style.css\" rel=\"stylesheet\" type=\"text\/css\" \/&gt;<\/pre>\n<p>then the <strong>latest version of jQuery<\/strong> from <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/developers.google.com\/speed\/libraries\/\">Google\u2019s AJAX Libraries repository<\/a>:<\/p>\n<pre>&lt;script type=\"text\/javascript\" src=\"http:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1.4\/jquery.min.js\"&gt;&lt;\/script&gt;<\/pre>\n<p>and finally our <strong>JavaScript file<\/strong> :<\/p>\n<pre>&lt;script type=\"text\/javascript\" src=\"script.js\"&gt;&lt;\/script&gt;<\/pre>\n<p>Now our <code>&lt;head&gt;<\/code> should look something like this :<\/p>\n<pre>\r\n &lt;head&gt;\r\n &lt;script type=\"text\/javascript\" src=\"http:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1.4\/jquery.min.js\"&gt;&lt;\/script&gt;\r\n &lt;script type=\"text\/javascript\" src=\"script.js\"&gt;&lt;\/script&gt;\r\n &lt;link href=\"style.css\" rel=\"stylesheet\" type=\"text\/css\" \/&gt;\r\n &lt;\/head&gt;\r\n <\/pre>\n<p>Let\u2019s put codes for the our buttons inside <code>&lt;body&gt;<\/code> tag :<\/p>\n<pre>\r\n &lt;p&gt;&lt;a href=\"#\" class=\"button1\"&gt;&lt;\/a&gt;&lt;\/p&gt; &lt;!-- CSS only --&gt;\r\n &lt;p class=\"button2\"&gt;&lt;a href=\"#\"&gt;&lt;\/a&gt;&lt;\/p&gt; &lt;!-- CSS + jQuery --&gt;<\/pre>\n<p><strong class=\"u\">Explanation:<\/strong> We\u2019ve created paragraphs for two buttons, each wrapped with <code>&lt;p&gt;&lt;\/p&gt;<\/code> with hyperlink <code>&lt;a&gt;&lt;\/a&gt;<\/code> inside.\n  Line 1: <code>class=\"button1\"<\/code> is placed inside <code>&lt;a&gt;<\/code>, while\n  Line 2: <code>class=\"button1\"<\/code> is placed inside <code>&lt;p&gt;<\/code>\n<\/p>\n<h3>Step 3.1 \u2013 CSS only Button<\/h3>\n<p>We will create our first button, using CSS only. Open up <code>style.css<\/code> and paste the following codes inside.<\/p>\n<pre>\r\n .button1 \/bin \/boot \/dev \/etc \/home \/initrd.img \/initrd.img.old \/lib \/lib64 \/lost+found \/media \/mnt \/opt \/proc \/root \/run \/sbin \/snap \/srv \/sys \/tmp \/usr \/var \/vmlinuz \/vmlinuz.old Button with CSS only _old\/ \r\n {\r\n background: url(images\/download.png) 0 0;\r\n height:65px;\r\n width:580px;\r\n display:block;\r\n }\r\n .button1:hover \/bin \/boot \/dev \/etc \/home \/initrd.img \/initrd.img.old \/lib \/lib64 \/lost+found \/media \/mnt \/opt \/proc \/root \/run \/sbin \/snap \/srv \/sys \/tmp \/usr \/var \/vmlinuz \/vmlinuz.old mouseOver _old\/ \r\n {\r\n background: url(images\/download.png) 0 65px;\r\n }\r\n <\/pre>\n<p><strong class=\"u\">Explanation:<\/strong> Our first button is a 100% HTML\/CSS button. CSS property <code>background<\/code> loads the <em>download.png<\/em> image with exactly the image\u2019s <code>width<\/code> 580px but only half the <code>height<\/code> 65px (130\/2) so only one of the two buttons in <em>download.png<\/em> is displayed. Button\u2019s position is determined and controlled by the last value of <code>background<\/code> property. Think of the last value of <code>background<\/code> property as where (in terms of height position in pixel) the image should start from.\n<\/p>\n<h3>Step 3.2 \u2013 CSS + jQuery Button<\/h3>\n<p>We\u2019ll be using the same image <em>download.png<\/em> for our second button. The difference here is: our second button will be injected with jQuery effect to make the animation smoother.<strong> Let\u2019s start with the CSS<\/strong>. Place the follow codes inside <code>style.css<\/code>.<\/p>\n<pre>\r\n .button2, .button2 a {\r\n background: url(images\/download.png) 0 -65px;\r\n height:65px;\r\n width:580px;\r\n display:block;\r\n }\r\n .button2 a {\r\n background-position: 0 0;\r\n }\r\n <\/pre>\n<p><strong class=\"u\">Explanation:<\/strong> Basically both <code>.button2 {}<\/code> and <code>.button2 a {}<\/code> shares the same style except for the last value in <code>background<\/code> property. <code>.button2 {}<\/code> displays the blue color button while<code>.button2 a {}<\/code> displays white color button.<\/p>\n<figure><img decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/call2action_button_tuts\/image7.jpg\"><\/figure>\n<p>CSS part is done. We\u2019ll use jQuery to swap between both states to create a smooth transition effect. Open up <code>script.js<\/code> and put the following code inside.<\/p>\n<pre>\r\n $(document).ready(function(){\r\n $('.button2 a').hover(function(){\r\n $(this).stop().animate({'opacity' : '0'}, 500);\r\n }, function(){$(this).stop().animate({'opacity' : '1'}, 500);});\r\n });<\/pre>\n<p><strong class=\"u\">Explanation:<\/strong> <span class=\"js\"><code>$(this)<\/code><\/span> refer to <span class=\"js\"><code>.button2 a<\/code><\/span> and when it is hovered, we are going to use the jQuery animation to set the opacity of this element to <code>0<\/code> so we can see the <code>.button2<\/code> element (blue button). And when the mouse is out we are going to setback the opacity to <code>1<\/code> with <code>500<\/code> milliseconds for the animation speed.\n<\/p>\n<h2>That\u2019s it !<\/h2>\n<p>Thanks for following this tutorial. I hope you liked it and managed to follow it step by step. If you\u2019ve done everything correctly, you should have ended up with something <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/assets.hongkiat.com\/uploads\/call2action_button_tuts\/demo\/index.html\">like this<\/a>. If you have any problem or you need some help feel free to write your question into the comments section.<\/p>\n<p>Here are a re-cap of all required files for this tutorial:<\/p>\n<ul>\n<li><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/assets.hongkiat.com\/uploads\/call2action_button_tuts\/downloads\/button.psd\">Download button (.PSD)<\/a><\/li>\n<li><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/assets.hongkiat.com\/uploads\/call2action_button_tuts\/downloads\/call2action_tut.zip\">Download tutorial<\/a><\/li>\n<li><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/assets.hongkiat.com\/uploads\/call2action_button_tuts\/demo\/index.html\">Demo<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Call to action in web design is a term used for elements in a web page that solicit an action from the user (clicking, hovering, etc). Today we\u2019re going to create an effective and awesome call to action button with some CSS and jQuery that grab the user\u2019s attention and entice him to click .&hellip;<\/p>\n","protected":false},"author":413,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[352],"tags":[298,1402,911],"topic":[4520],"class_list":["entry-content","is-maxi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v22.8 (Yoast SEO v27.6) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Simple &quot;Call To Action&quot; Button With CSS &amp; jQuery - Hongkiat<\/title>\n<meta name=\"description\" content=\"Call to action in web design is a term used for elements in a web page that solicit an action from the user (clicking, hovering, etc). Today we&#039;re going\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hongkiat.com\/blog\/simple-call-to-action-button-with-css-jquery\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Simple &quot;Call To Action&quot; Button With CSS &amp; jQuery\" \/>\n<meta property=\"og:description\" content=\"Call to action in web design is a term used for elements in a web page that solicit an action from the user (clicking, hovering, etc). Today we&#039;re going\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/simple-call-to-action-button-with-css-jquery\/\" \/>\n<meta property=\"og:site_name\" content=\"Hongkiat\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hongkiatcom\" \/>\n<meta property=\"article:published_time\" content=\"2010-05-21T14:30:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-03T16:41:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/assets.hongkiat.com\/uploads\/call2action_button_tuts\/set-new-guide.jpg\" \/>\n<meta name=\"author\" content=\"Ryan Ryan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ryan Ryan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/simple-call-to-action-button-with-css-jquery\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/simple-call-to-action-button-with-css-jquery\\\/\"},\"author\":{\"name\":\"Ryan Ryan\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/368315b2c93dd1f9d09ec7aecabf615c\"},\"headline\":\"Simple &quot;Call To Action&quot; Button With CSS &amp; jQuery\",\"datePublished\":\"2010-05-21T14:30:38+00:00\",\"dateModified\":\"2025-04-03T16:41:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/simple-call-to-action-button-with-css-jquery\\\/\"},\"wordCount\":840,\"commentCount\":59,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/simple-call-to-action-button-with-css-jquery\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/call2action_button_tuts\\\/set-new-guide.jpg\",\"keywords\":[\"Buttons\",\"Call to Action\",\"jQuery\"],\"articleSection\":[\"Web Design\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/simple-call-to-action-button-with-css-jquery\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/simple-call-to-action-button-with-css-jquery\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/simple-call-to-action-button-with-css-jquery\\\/\",\"name\":\"Simple &quot;Call To Action&quot; Button With CSS &amp; jQuery - Hongkiat\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/simple-call-to-action-button-with-css-jquery\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/simple-call-to-action-button-with-css-jquery\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/call2action_button_tuts\\\/set-new-guide.jpg\",\"datePublished\":\"2010-05-21T14:30:38+00:00\",\"dateModified\":\"2025-04-03T16:41:21+00:00\",\"description\":\"Call to action in web design is a term used for elements in a web page that solicit an action from the user (clicking, hovering, etc). Today we're going\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/simple-call-to-action-button-with-css-jquery\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/simple-call-to-action-button-with-css-jquery\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/simple-call-to-action-button-with-css-jquery\\\/#primaryimage\",\"url\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/call2action_button_tuts\\\/set-new-guide.jpg\",\"contentUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/call2action_button_tuts\\\/set-new-guide.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/simple-call-to-action-button-with-css-jquery\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Simple &quot;Call To Action&quot; Button With CSS &amp; jQuery\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"name\":\"Hongkiat\",\"description\":\"Tech and Design Tips\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\",\"name\":\"Hongkiat.com\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"contentUrl\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"width\":1200,\"height\":799,\"caption\":\"Hongkiat.com\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/hongkiatcom\",\"https:\\\/\\\/x.com\\\/hongkiat\",\"https:\\\/\\\/www.pinterest.com\\\/hongkiat\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/368315b2c93dd1f9d09ec7aecabf615c\",\"name\":\"Ryan Ryan\",\"description\":\"Ryan is a web developer (Javascript, PHP, XHTML, CSS) cum designer who loves Photoshop.\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/ryanturki\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Simple &quot;Call To Action&quot; Button With CSS &amp; jQuery - Hongkiat","description":"Call to action in web design is a term used for elements in a web page that solicit an action from the user (clicking, hovering, etc). Today we're going","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.hongkiat.com\/blog\/simple-call-to-action-button-with-css-jquery\/","og_locale":"en_US","og_type":"article","og_title":"Simple &quot;Call To Action&quot; Button With CSS &amp; jQuery","og_description":"Call to action in web design is a term used for elements in a web page that solicit an action from the user (clicking, hovering, etc). Today we're going","og_url":"https:\/\/www.hongkiat.com\/blog\/simple-call-to-action-button-with-css-jquery\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2010-05-21T14:30:38+00:00","article_modified_time":"2025-04-03T16:41:21+00:00","og_image":[{"url":"https:\/\/assets.hongkiat.com\/uploads\/call2action_button_tuts\/set-new-guide.jpg","type":"","width":"","height":""}],"author":"Ryan Ryan","twitter_card":"summary_large_image","twitter_creator":"@hongkiat","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Ryan Ryan","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/simple-call-to-action-button-with-css-jquery\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/simple-call-to-action-button-with-css-jquery\/"},"author":{"name":"Ryan Ryan","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/368315b2c93dd1f9d09ec7aecabf615c"},"headline":"Simple &quot;Call To Action&quot; Button With CSS &amp; jQuery","datePublished":"2010-05-21T14:30:38+00:00","dateModified":"2025-04-03T16:41:21+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/simple-call-to-action-button-with-css-jquery\/"},"wordCount":840,"commentCount":59,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/simple-call-to-action-button-with-css-jquery\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/call2action_button_tuts\/set-new-guide.jpg","keywords":["Buttons","Call to Action","jQuery"],"articleSection":["Web Design"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hongkiat.com\/blog\/simple-call-to-action-button-with-css-jquery\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/simple-call-to-action-button-with-css-jquery\/","url":"https:\/\/www.hongkiat.com\/blog\/simple-call-to-action-button-with-css-jquery\/","name":"Simple &quot;Call To Action&quot; Button With CSS &amp; jQuery - Hongkiat","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/simple-call-to-action-button-with-css-jquery\/#primaryimage"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/simple-call-to-action-button-with-css-jquery\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/call2action_button_tuts\/set-new-guide.jpg","datePublished":"2010-05-21T14:30:38+00:00","dateModified":"2025-04-03T16:41:21+00:00","description":"Call to action in web design is a term used for elements in a web page that solicit an action from the user (clicking, hovering, etc). Today we're going","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/simple-call-to-action-button-with-css-jquery\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/simple-call-to-action-button-with-css-jquery\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/simple-call-to-action-button-with-css-jquery\/#primaryimage","url":"https:\/\/assets.hongkiat.com\/uploads\/call2action_button_tuts\/set-new-guide.jpg","contentUrl":"https:\/\/assets.hongkiat.com\/uploads\/call2action_button_tuts\/set-new-guide.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/simple-call-to-action-button-with-css-jquery\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Simple &quot;Call To Action&quot; Button With CSS &amp; jQuery"}]},{"@type":"WebSite","@id":"https:\/\/www.hongkiat.com\/blog\/#website","url":"https:\/\/www.hongkiat.com\/blog\/","name":"Hongkiat","description":"Tech and Design Tips","publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hongkiat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hongkiat.com\/blog\/#organization","name":"Hongkiat.com","url":"https:\/\/www.hongkiat.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","contentUrl":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","width":1200,"height":799,"caption":"Hongkiat.com"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/hongkiatcom","https:\/\/x.com\/hongkiat","https:\/\/www.pinterest.com\/hongkiat\/"]},{"@type":"Person","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/368315b2c93dd1f9d09ec7aecabf615c","name":"Ryan Ryan","description":"Ryan is a web developer (Javascript, PHP, XHTML, CSS) cum designer who loves Photoshop.","url":"https:\/\/www.hongkiat.com\/blog\/author\/ryanturki\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-1WT","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/7495","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/users\/413"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=7495"}],"version-history":[{"count":3,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/7495\/revisions"}],"predecessor-version":[{"id":73498,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/7495\/revisions\/73498"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=7495"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=7495"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=7495"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=7495"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}