{"id":594,"date":"2010-07-06T10:41:41","date_gmt":"2010-07-06T05:11:41","guid":{"rendered":"http:\/\/JitendraZaa.com\/blog\/?p=594"},"modified":"2010-07-06T10:41:41","modified_gmt":"2010-07-06T05:11:41","slug":"create-gradient-header-using-css","status":"publish","type":"post","link":"https:\/\/www.jitendrazaa.com\/blog\/webtech\/web\/create-gradient-header-using-css\/","title":{"rendered":"Create Gradient Header using CSS"},"content":{"rendered":"<p>Many designers resist using header tags (H1, H2, etc.) on their Web pages because the spacing around the tags can break a tight page layout.<\/p>\n<p style=\"text-align: center;\">\n<figure id=\"attachment_595\" aria-describedby=\"caption-attachment-595\" style=\"width: 430px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/jitendrazaa.com\/blog\/wp-content\/uploads\/2010\/07\/header.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-595 \" title=\"Create attractive headers in HTML using CSS\" src=\"https:\/\/i0.wp.com\/jitendrazaa.com\/blog\/wp-content\/uploads\/2010\/07\/header.png?resize=430%2C290&#038;ssl=1\" alt=\"Create attractive headers in HTML using CSS\" width=\"430\" height=\"290\" \/><\/a><figcaption id=\"caption-attachment-595\" class=\"wp-caption-text\">Create attractive headers in HTML using CSS<\/figcaption><\/figure>\n<p>Heading tags (H1 through to H6) are given<strong> more weight by search engines<\/strong> than regular body copy. So they should be used wisely to reinforce the page&#8217;s overall keyword theme&#8230;&#8230;<strong>By SEO<\/strong><\/p>\n<p>I have used header tags and applied some css effects, it easy to write with 10-12 line of css and html\u00a0Output will look like image shown.<\/p>\n<p>First we need to add a div tag to our html page to put header on it.<\/p>\n<p>Css for div:<\/p>\n<pre class=\"brush: css; title: ; notranslate\" title=\"\">\n#container {\n\tbackground: #6699FF;\n\tmargin: auto;\n\twidth: 500px;\n\theight: 700px;\n\tpadding-top: 30px;\n\tfont-family: helvetica, arial, sans-serif;\n\t}\n<\/pre>\n<p>We will use this as<\/p>\n<div id=\"container\" style=\"text-align: left;\">Css for Header Tag..<\/p>\n<pre class=\"brush: css; title: ; notranslate\" title=\"\">\nh1 {\n\t background: red;             \/*Background color to header*\/\n\t background: -moz-linear-gradient(top, red, FFFFFF);\n              \/*from to colors, I have used simple name it can be replaced by color codes*\/\n\t background: -webkit-gradient(linear, left top, left bottom, from(red), to(white));\n\t padding: 10px 20px;\n\t margin-left: -20px;\n\t margin-top: 0;\n\t position: relative;\n\t width: 70%;\n       \/*from droping box shadow at the bottom of header*\/\n\t-moz-box-shadow: 1px 1px 3px #292929;\n\t-webkit-box-shadow: 1px 1px 3px #292929;\n                 box-shadow: 1px 1px 3px #292929;\n\tcolor: #454545;\n\ttext-shadow: 0 1px 0 white;\n}\n<\/pre>\n<p>Arrow class for dropping shadow.<\/p>\n<pre class=\"brush: css; title: ; notranslate\" title=\"\">\n.arrow {\n\t width: 0; height: 0;\n\t line-height: 0;\n\t border-left: 20px solid transparent;\n\t border-top: 10px solid #c8c8c8;\n\t top: 104%;\n\t left: 0;\n\t position: absolute;\n}\n<\/pre>\n<p>Now just create a html Page and put a header and you have done assuming that you have written css in separate file named jstyle.css.<br \/>\nExample:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&lt;html &gt;\n&lt;head&gt;\n    &lt;link rel=&quot;Stylesheet&quot; type=&quot;text\/css&quot; href=&quot;jstyle.css&quot; \/&gt;\n\t&lt;title&gt;CSS Header&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n\t &lt;div id=&quot;container&quot;&gt;\n\t\t&lt;h1&gt; H1 - Heading &lt;span class=&quot;arrow&quot;&gt;&lt;\/span&gt; &lt;\/h1&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;\n<\/pre>\n<p><a href=\"https:\/\/jitendrazaa.com\/blog\/wp-content\/uploads\/2010\/07\/cssheader.html\">Live Demo of CSS Header<\/a><\/p>\n<p>Note: This will not work on browsers which does not support CSS3.<\/p>\n<p><a href=\"https:\/\/jitendrazaa.com\/blog\/wp-content\/uploads\/2010\/07\/cssheader.html\"><\/a><strong>About Author:<\/strong><br \/>\nJayant Bramhnakar<br \/>\nSr. Web Developer<br \/>\nSahyadri Technologies Pvt. Ltd(Satara)<br \/>\n<span style=\"color: #0000ff;\"><span style=\"text-decoration: underline;\"> jayantbramhankar@gmail.com<br \/>\njayant@sahyadritechnologies.com <\/span><\/span><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Create a Gradient effect in heading tag of HTML using simple CSS trick<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"jz_research_post":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[26],"tags":[67],"class_list":["post-594","post","type-post","status-publish","format-standard","hentry","category-web","tag-css"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":2173,"url":"https:\/\/www.jitendrazaa.com\/blog\/webtech\/web\/create-pure-css-based-menu-step-by-step-tutorial\/","url_meta":{"origin":594,"position":0},"title":"Create Pure CSS based Menu &#8211; Step by Step Tutorial","author":"Jitendra","date":"May 23, 2011","format":false,"excerpt":"Tutorial on creating step by step pure CSS based Menu without any javaScript and Why CSS Hover property is not working in Internet explorer","rel":"","context":"In &quot;HTML&quot;","block_context":{"text":"HTML","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/webtech\/web\/"},"img":{"alt_text":"Pure CSS based menu","src":"https:\/\/i0.wp.com\/jitendrazaa.com\/blog\/wp-content\/uploads\/2011\/05\/Pure-CSS-based-menu.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":2657,"url":"https:\/\/www.jitendrazaa.com\/blog\/webtech\/web\/create-simple-drag-and-drop-widget-like-igoogle-using-jquery\/","url_meta":{"origin":594,"position":1},"title":"Create Simple Drag and Drop Widget like iGoogle using JQuery","author":"Jitendra","date":"January 20, 2012","format":false,"excerpt":"Live Demo with source code on creating Simple Drag and Drop Widget using JQuery plugin like iGoogle","rel":"","context":"In &quot;HTML&quot;","block_context":{"text":"HTML","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/webtech\/web\/"},"img":{"alt_text":"jQuery Drag and Drop Widgets","src":"https:\/\/i0.wp.com\/jitendrazaa.com\/blog\/wp-content\/uploads\/2012\/01\/jQuery-Drag-and-Drop-Widgets.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jitendrazaa.com\/blog\/wp-content\/uploads\/2012\/01\/jQuery-Drag-and-Drop-Widgets.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jitendrazaa.com\/blog\/wp-content\/uploads\/2012\/01\/jQuery-Drag-and-Drop-Widgets.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":65,"url":"https:\/\/www.jitendrazaa.com\/blog\/webtech\/web\/highlight-current-field-using-jquery\/","url_meta":{"origin":594,"position":2},"title":"Highlight Current field using JQuery","author":"Jitendra","date":"May 10, 2010","format":false,"excerpt":"Write below HTML code : This will create two text boxes. [sourcecode lang=\"css\"] <form> <div> <label for=\"Name\">Name:<\/label> <input name=\"Name\" type=\"text\"><\/input> <\/div> <div> <label for=\"Email\">Email:<\/label> <input name=\"Email\" type=\"text\"><\/input> <\/div> <\/form> [\/sourcecode] Using jQuery, we can watch for an event where an input form comes into focus: Add link to JQuery file\u2026","rel":"","context":"In &quot;HTML&quot;","block_context":{"text":"HTML","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/webtech\/web\/"},"img":{"alt_text":"Selecting field using jquery","src":"https:\/\/i0.wp.com\/jitendrazaa.com\/blog\/wp-content\/uploads\/2010\/05\/11-300x50.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":929,"url":"https:\/\/www.jitendrazaa.com\/blog\/webtech\/web\/vertically-middle-align-the-div-tag\/","url_meta":{"origin":594,"position":3},"title":"Vertically middle align the DIV tag using CSS","author":"Jitendra","date":"August 31, 2010","format":false,"excerpt":"Source code and Methods to Middle align the text in DIV tag in HTML","rel":"","context":"In &quot;HTML&quot;","block_context":{"text":"HTML","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/webtech\/web\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5970,"url":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/generic-and-responsive-table-component-in-salesforce-lightning\/","url_meta":{"origin":594,"position":4},"title":"Generic and Responsive Table Component in Salesforce Lightning","author":"Jitendra","date":"March 31, 2017","format":false,"excerpt":"Complete Source code to create generic and responsive Table component in Salesforce Lightning","rel":"","context":"In &quot;Salesforce&quot;","block_context":{"text":"Salesforce","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/salesforce\/"},"img":{"alt_text":"JSON format for responsive datagrid Lightning component","src":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2017\/03\/JSON-format-for-responsive-datagrid-Lightning-component.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":5389,"url":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/responsive-datagrid-component-in-lightning-basics\/","url_meta":{"origin":594,"position":5},"title":"Responsive Datagrid component in Lightning &#8211; Basics","author":"Jitendra","date":"March 15, 2016","format":false,"excerpt":"This blog post explains simple use case of Nested Lightning Component. It goes through example on how to interact and combine nested components to be used in parent Lightning component.","rel":"","context":"In &quot;Salesforce&quot;","block_context":{"text":"Salesforce","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/salesforce\/"},"img":{"alt_text":"Using Nested Lightning component to create responsive DataGrid","src":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2016\/03\/Lightning-Data-Grid-1.gif?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2016\/03\/Lightning-Data-Grid-1.gif?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2016\/03\/Lightning-Data-Grid-1.gif?resize=525%2C300&ssl=1 1.5x"},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/posts\/594","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/comments?post=594"}],"version-history":[{"count":0,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/posts\/594\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/media?parent=594"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/categories?post=594"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/tags?post=594"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}