{"id":15095,"date":"2019-10-05T16:34:05","date_gmt":"2019-10-05T08:34:05","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=15095"},"modified":"2022-07-15T17:06:30","modified_gmt":"2022-07-15T09:06:30","slug":"css3-linear-gradient","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/css3-linear-gradient\/","title":{"rendered":"A Guide to CSS3 Linear Gradients"},"content":{"rendered":"<p><strong>Gradient<\/strong> is a great color feature addition in <a href=\"https:\/\/www.hongkiat.com\/blog\/tag\/series-html5-css3-tuts\/\/\">CSS3<\/a>. Rather than only add a single color, we can now add multiple color combinations in one declaration block without relying on images, which could <a href=\"https:\/\/www.hongkiat.com\/blog\/ultimate-guide-to-web-optimization-tips-best-practices\/\">decrease the HTTP request in our website<\/a> allowing the website load faster.<\/p>\n<p>If you have played around with gradients in CSS3 you are probably familiar with the two methods: radial and linear gradient. Today\u2019s post will be about the latter.<\/p>\n<h2>Creating Gradients<\/h2>\n<p>As the spec says <a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\/\/drafts.csswg.org\/css-images-3\/\">gradients in CSS3 is an image<\/a>, it has no special property like other new feature addition, so it is declared using the <code>background-image<\/code> property instead.<\/p>\n<p>If we take a look at the complete syntax for gradient, it looks a little <em>overstuffed<\/em>, which  could lead to confusion for some people.<\/p>\n<pre>\r\ndiv {\r\n\tbackground-image: -webkit-linear-gradient(top, #FF5A00 0%, #FFAE00 100%);\r\n\tbackground-image: -moz-linear-gradient(top, #FF5A00 0%, #FFAE00 100%);\r\n\tbackground-image: -ms-linear-gradient(top, #FF5A00 0%, #FFAE00 100%);\r\n\tbackground-image: -o-linear-gradient(top, #FF5A00 0%, #FFAE00 100%);\r\n\tbackground-image: linear-gradient(top, #FF5A00 0%, #FFAE00 100%);\r\n}\r\n<\/pre>\n<p>So let\u2019s dig into each part of the syntax one by one to make things clearer.<\/p>\n<p>First of all, linear gradient is declared with the <code>linear-gradient()<\/code> function. The function has three primary values. The first value defines the gradient starting position. You can use a descriptive keyword, like <code>top<\/code> to start the gradient flowing from the <strong>top<\/strong>;<\/p>\n<pre>\r\ndiv {\r\n\tbackground-image: linear-gradient(top, #FF5A00, #FFAE00);\t\r\n}  \r\n<\/pre>\n<p>The snippet above is the official version from <a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\/\/www.w3.org\/\">W3C<\/a> to create gradients. It\u2019s actually simpler and quite self-explanatory and it will also create the following gradient.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/css3-linear-gradient\/gradient-top.jpg\" alt=\"gradient top\" width=\"500\" height=\"300\"><\/figure>\n<p>You can also use <code>bottom<\/code> to do the opposite, or else <code>right<\/code> and <code>left<\/code>.<\/p>\n<p>We can also create a diagonal gradient using <code>angle degree<\/code> as the gradient starting position. Here is an example:<\/p>\n<pre>\r\ndiv {\r\n\tbackground-image: linear-gradient(45deg, #FF5A00, #FFAE00);\r\n}\r\n<\/pre>\n<p>The snippet above will create the following color gradient:<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/css3-linear-gradient\/gradient-diagonal.jpg\" alt=\"gradient diagonal\" width=\"500\" height=\"300\"><\/figure>\n<p>The second value of the function will tell the <strong>first color<\/strong> information and its <strong>stop position<\/strong> which is stated in percentage. The stop position actually is optional; the browser is clever enough to determine the proper position, so when we don\u2019t specify the first color\u2019s stop the browser will take <code>0%<\/code> as the default.<\/p>\n<p>And, the next value is the <strong>second color<\/strong> combination. It works like the previous value, only that if it is the last color applied, and we do not specified the <strong>stop position<\/strong>, a value of <code>100%<\/code> will be taken as the default. Now, let\u2019s look at the example below:<\/p>\n<pre>\r\ndiv {\r\n\tbackground-image: linear-gradient(top, #FF5A00 0%, #FFAE00 100%);\r\n}\r\n<\/pre>\n<p>The snippet above will create a gradient like what we saw earlier (no difference) but now we specify the color stop position;<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/css3-linear-gradient\/gradient-top.jpg\" alt=\"gradient top\" width=\"500\" height=\"300\"><\/figure>\n<p>Now let\u2019s change the <strong>color stop<\/strong>, and this time we will specify <code>50%<\/code> for the first color and <code>51%<\/code> for the second color, and let\u2019s see how it turns out;<\/p>\n<pre>\r\ndiv {\r\n\tbackground-image: linear-gradient(top, #FF5A00 50%, #FFAE00 51%);\r\n}\r\n<\/pre>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/css3-linear-gradient\/gradient-stop.jpg\" alt=\"gradient stop\" width=\"500\" height=\"300\"><\/figure>\n<h2>Transparency<\/h2>\n<p>Creating <code>transparency<\/code> in gradient is also possible. To create the effect we need to translate the color <code>hex<\/code> into <code>rgba<\/code> mode and lower the alpha channel.<\/p>\n<pre>\r\ndiv {\r\n\tbackground-image: linear-gradient(top, rgba(255,90,0,0.2), rgb(255,174,0,0.2));\r\n}\t\r\n<\/pre>\n<p>The snippet above will lower the color intensity by <code>20%<\/code>, and the gradient will turn out like this:<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/css3-linear-gradient\/gradient-transparent.jpg\" alt=\"gradient transparent\" width=\"500\" height=\"300\"><\/figure>\n<h2>Multiple Colors<\/h2>\n<p>Should you want more colors to be added, just add the colors next to another with a comma delimiter and let the browser determine each color stop position.<\/p>\n<pre>\r\ndiv {\r\n\tbackground-image: linear-gradient(top, red, orange, yellow, green, blue, indigo, violet);\r\n}\r\n<\/pre>\n<p>The snippet above will create the following rainbow.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/css3-linear-gradient\/gradient-rainbow.jpg\" alt=\"gradient rainbow\" width=\"500\" height=\"300\"><\/figure>\n<h2>Browser Compatibility<\/h2>\n<p>Unfortunately, at the time of this writing, all current browsers have yet to support the standard syntax. They still need the vendor prefix (<code>-webkit-<\/code>, <code>-moz-<\/code>, <code>-ms-<\/code> and <code>-o-<\/code>). So, that is why the complete syntax appears like this:<\/p>\n<pre>\r\ndiv {\r\n\tbackground-image: -webkit-linear-gradient(top, #FF5A00 0%, #FFAE00 100%);\r\n\tbackground-image: -moz-linear-gradient(top, #FF5A00 0%, #FFAE00 100%);\r\n\tbackground-image: -ms-linear-gradient(top, #FF5A00 0%, #FFAE00 100%);\r\n\tbackground-image: -o-linear-gradient(top, #FF5A00 0%, #FFAE00 100%);\r\n\tbackground-image: linear-gradient(top, #FF5A00 0%, #FFAE00 100%);\r\n}\r\n<\/pre>\n<p>On the other hand, the <a target=\"_blank\" href=\"https:\/\/www.hongkiat.com\/blog\/tag\/ie\/\" rel=\"noopener noreferrer\">Internet Explorer<\/a>, specifically version 9 and lower, is far from the standard. The gradient in <strong>IE9<\/strong> and below is declared with <code>filter<\/code>, so if we want to add gradient on those browsers, we have to write something like this;<\/p>\n<pre>\r\ndiv {\r\n\tfilter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#FF5A00, endColorstr=#FFAE00);\r\n}\r\n<\/pre>\n<p>The <code>filter<\/code> has its limitations: first, it does not allow more than three colors added, and creating the transparency effect is also a bit tricky \u2013 it does not allow <code>rgba<\/code>, but the IE <code>filter<\/code> uses <code>#ARGB<\/code>;<\/p>\n<pre>\r\ndiv {\r\n\tfilter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#33FF5A00, endColorstr=#33FFAE00);\r\n}\r\n<\/pre>\n<p>Here is a tool to help you <a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\/\/kilianvalkhof.com\/2010\/css-html\/how-to-use-rgba-in-ie\/\">convert <code>rgba<\/code> to <code>#ARGB<\/code><\/a>.<\/p>\n<ul class=\"download download-2c\">\n<li><a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\/\/hongkiat.github.io\/css3-linear-gradient\/\">Demo<\/a><\/li>\n<li><a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\/\/github.com\/hongkiat\/css3-linear-gradient\/\">Download Source<\/a><\/li>\n<\/ul>\n<h2>Writing the Syntax Faster<\/h2>\n<p>As you can see above, in order to maintain the gradient compatibility <a target=\"_blank\" href=\"https:\/\/www.hongkiat.com\/blog\/20-awesome-battle-of-the-browsers-artworks\/\" rel=\"noopener noreferrer\">across browsers<\/a>, we need to add five more lines of codes which <a target=\"_blank\" href=\"https:\/\/www.hongkiat.com\/blog\/keep-css3-markup-slim\/\" rel=\"noopener noreferrer\">is inefficient<\/a>.<\/p>\n<p>There are many ways we can do to simplify the task; such as using the <a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"http:\/\/leaverou.github.com\/prefixfree\/\">Prefix-free<\/a>, <a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"http:\/\/prefixr.com\/\">Prefixr<\/a>, <a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\/\/lesscss.org\/\">LESS<\/a> or <a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\/\/sass-lang.com\/\">Sass<\/a> to help compile the codes, but above all, we recommend using this tool, <a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\/\/www.colorzilla.com\/gradient-editor\/\">ColorZilla Gradient<\/a>. This tool will simply generate all the necessary codes for the gradients to work in all browsers.<\/p>\n<h2>Final Words<\/h2>\n<p>Today we have discussed quite a lot on creating gradients, we have looked into each part of the syntax, creating transparent effects and <a target=\"_blank\" href=\"https:\/\/www.hongkiat.com\/blog\/complete-guide-to-cross-browser-compatibility-check\/\" rel=\"noopener noreferrer\">maintaining browser compatibility<\/a>. So, at this point, we hope that you already have a <a target=\"_blank\" href=\"https:\/\/www.hongkiat.com\/blog\/type-of-learner-infographic\/\" rel=\"noopener noreferrer\">better understanding on the subject<\/a>.<\/p>\n<p>There are still many things we plan to explore on <strong>CSS3 Gradients<\/strong> in our future posts, so stay tune to Hongkiat.com. Lastly, thank you for reading this post, we hope you enjoyed it.<\/p>\n<h2>Further Reading<\/h2>\n<ul>\n<li><a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\/\/lea.verou.me\/2009\/02\/bulletproof-cross-browser-rgba-backgrounds\/\">Bullet Proof Cross Browser RGBA Backgrounds<\/a> \u2013 Lea Verou<\/li>\n<li><a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\/\/drafts.csswg.org\/css-images-3\/\">CSS3 Image<\/a> \u2013 W3.org<\/li>\n<li><a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\/\/caniuse.com\/css-gradients\">When can I use CSS3 Gradients<\/a> \u2013 CanIUse.com<\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Gradient is a great color feature addition in CSS3. Rather than only add a single color, we can now add multiple color combinations in one declaration block without relying on images, which could decrease the HTTP request in our website allowing the website load faster. If you have played around with gradients in CSS3 you&hellip;<\/p>\n","protected":false},"author":113,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3392,352],"tags":[507,506,2016],"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.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>A Guide to CSS3 Linear Gradients - Hongkiat<\/title>\n<meta name=\"description\" content=\"Gradient is a great color feature addition in CSS3. Rather than only add a single color, we can now add multiple color combinations in one declaration\" \/>\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\/css3-linear-gradient\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"A Guide to CSS3 Linear Gradients\" \/>\n<meta property=\"og:description\" content=\"Gradient is a great color feature addition in CSS3. Rather than only add a single color, we can now add multiple color combinations in one declaration\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/css3-linear-gradient\/\" \/>\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=\"2019-10-05T08:34:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-07-15T09:06:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/assets.hongkiat.com\/uploads\/css3-linear-gradient\/gradient-top.jpg\" \/>\n<meta name=\"author\" content=\"Thoriq Firdaus\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@tfirdaus\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Thoriq Firdaus\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-linear-gradient\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-linear-gradient\\\/\"},\"author\":{\"name\":\"Thoriq Firdaus\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/e7948c7a175d211496331e4b6ce55807\"},\"headline\":\"A Guide to CSS3 Linear Gradients\",\"datePublished\":\"2019-10-05T08:34:05+00:00\",\"dateModified\":\"2022-07-15T09:06:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-linear-gradient\\\/\"},\"wordCount\":790,\"commentCount\":41,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-linear-gradient\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/css3-linear-gradient\\\/gradient-top.jpg\",\"keywords\":[\"CSS\",\"HTML\",\"HTML5 \\\/ CSS3 Tutorials\"],\"articleSection\":[\"Coding\",\"Web Design\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-linear-gradient\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-linear-gradient\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-linear-gradient\\\/\",\"name\":\"A Guide to CSS3 Linear Gradients - Hongkiat\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-linear-gradient\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-linear-gradient\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/css3-linear-gradient\\\/gradient-top.jpg\",\"datePublished\":\"2019-10-05T08:34:05+00:00\",\"dateModified\":\"2022-07-15T09:06:30+00:00\",\"description\":\"Gradient is a great color feature addition in CSS3. Rather than only add a single color, we can now add multiple color combinations in one declaration\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-linear-gradient\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-linear-gradient\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-linear-gradient\\\/#primaryimage\",\"url\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/css3-linear-gradient\\\/gradient-top.jpg\",\"contentUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/css3-linear-gradient\\\/gradient-top.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/css3-linear-gradient\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"A Guide to CSS3 Linear Gradients\"}]},{\"@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\\\/e7948c7a175d211496331e4b6ce55807\",\"name\":\"Thoriq Firdaus\",\"description\":\"Thoriq is a writer for Hongkiat.com with a passion for web design and development. He is the author of Responsive Web Design by Examples, where he covered his best approaches in developing responsive websites quickly with a framework.\",\"sameAs\":[\"https:\\\/\\\/thoriq.com\",\"https:\\\/\\\/x.com\\\/tfirdaus\"],\"jobTitle\":\"Web Developer\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/thoriq\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"A Guide to CSS3 Linear Gradients - Hongkiat","description":"Gradient is a great color feature addition in CSS3. Rather than only add a single color, we can now add multiple color combinations in one declaration","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\/css3-linear-gradient\/","og_locale":"en_US","og_type":"article","og_title":"A Guide to CSS3 Linear Gradients","og_description":"Gradient is a great color feature addition in CSS3. Rather than only add a single color, we can now add multiple color combinations in one declaration","og_url":"https:\/\/www.hongkiat.com\/blog\/css3-linear-gradient\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2019-10-05T08:34:05+00:00","article_modified_time":"2022-07-15T09:06:30+00:00","og_image":[{"url":"https:\/\/assets.hongkiat.com\/uploads\/css3-linear-gradient\/gradient-top.jpg","type":"","width":"","height":""}],"author":"Thoriq Firdaus","twitter_card":"summary_large_image","twitter_creator":"@tfirdaus","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Thoriq Firdaus","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/css3-linear-gradient\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/css3-linear-gradient\/"},"author":{"name":"Thoriq Firdaus","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/e7948c7a175d211496331e4b6ce55807"},"headline":"A Guide to CSS3 Linear Gradients","datePublished":"2019-10-05T08:34:05+00:00","dateModified":"2022-07-15T09:06:30+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/css3-linear-gradient\/"},"wordCount":790,"commentCount":41,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/css3-linear-gradient\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/css3-linear-gradient\/gradient-top.jpg","keywords":["CSS","HTML","HTML5 \/ CSS3 Tutorials"],"articleSection":["Coding","Web Design"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hongkiat.com\/blog\/css3-linear-gradient\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/css3-linear-gradient\/","url":"https:\/\/www.hongkiat.com\/blog\/css3-linear-gradient\/","name":"A Guide to CSS3 Linear Gradients - Hongkiat","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/css3-linear-gradient\/#primaryimage"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/css3-linear-gradient\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/css3-linear-gradient\/gradient-top.jpg","datePublished":"2019-10-05T08:34:05+00:00","dateModified":"2022-07-15T09:06:30+00:00","description":"Gradient is a great color feature addition in CSS3. Rather than only add a single color, we can now add multiple color combinations in one declaration","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/css3-linear-gradient\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/css3-linear-gradient\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/css3-linear-gradient\/#primaryimage","url":"https:\/\/assets.hongkiat.com\/uploads\/css3-linear-gradient\/gradient-top.jpg","contentUrl":"https:\/\/assets.hongkiat.com\/uploads\/css3-linear-gradient\/gradient-top.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/css3-linear-gradient\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"A Guide to CSS3 Linear Gradients"}]},{"@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\/e7948c7a175d211496331e4b6ce55807","name":"Thoriq Firdaus","description":"Thoriq is a writer for Hongkiat.com with a passion for web design and development. He is the author of Responsive Web Design by Examples, where he covered his best approaches in developing responsive websites quickly with a framework.","sameAs":["https:\/\/thoriq.com","https:\/\/x.com\/tfirdaus"],"jobTitle":"Web Developer","url":"https:\/\/www.hongkiat.com\/blog\/author\/thoriq\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-3Vt","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/15095","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\/113"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=15095"}],"version-history":[{"count":5,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/15095\/revisions"}],"predecessor-version":[{"id":48833,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/15095\/revisions\/48833"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=15095"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=15095"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=15095"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=15095"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}