{"id":569,"date":"2012-05-25T06:03:56","date_gmt":"2012-05-25T06:03:56","guid":{"rendered":"https:\/\/theextremewebdesigns.com\/blog\/?p=569"},"modified":"2012-05-25T06:03:56","modified_gmt":"2012-05-25T06:03:56","slug":"include-css-in-css","status":"publish","type":"post","link":"https:\/\/theextremewebdesigns.com\/blog\/include-css-in-css\/","title":{"rendered":"Include CSS in CSS"},"content":{"rendered":"<p><strong>Include CSS in CSS<\/strong> with just 1 line of code. Read on to find out more about this nifty little trick.<!--more--><\/p>\n<h2>Include CSS in CSS<\/h2>\n<p>Let us say that you have a main CSS file called &#8220;main.css&#8221; that contains all the styles for your website. Now you want to include a CSS file that works as a CSS Reset (If you do not know what <a title=\"CSS Reset: What is CSS Reset? Why to use CSS Reset? How to use CSS Reset?\" href=\"https:\/\/theextremewebdesigns.com\/blog\/css-reset-what-is-css-reset-why-to-use-css-reset-how-to-use-css-reset\/\" target=\"_blank\">CSS Reset<\/a>, is then read more about it <a title=\"CSS Reset: What is CSS Reset? Why to use CSS Reset? How to use CSS Reset?\" href=\"https:\/\/theextremewebdesigns.com\/blog\/css-reset-what-is-css-reset-why-to-use-css-reset-how-to-use-css-reset\/\" target=\"_blank\">here<\/a>), you can do it the following way, assuming that your CSS Reset file is name as &#8220;reset.css&#8221;:<\/p>\n<pre class=\"lang:css decode:true\">\/\/Contents of main.css\n\n@import url(\"reset.css\");\n\nh1 { }\nh2 { }\np { }<\/pre>\n<p><strong>@import url(&#8220;reset.css&#8221;);<\/strong> is the only line of code you need to include css in css. You can apply the same method to include multiple css in a single css file. Following is an example:<\/p>\n<pre class=\"lang:css decode:true  crayon-selected\">\/\/Contents of main.css\n\n@import url(\"reset.css\");\n@import url(\"colors.css\");\n@import url(\"forms.css\");\n\nh1 { }\nh2 { }\np { }<\/pre>\n<p>So as you can see, all you need is just 1 line of code whenever you want to<strong> include CSS in another CSS<\/strong>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Include CSS in CSS with just 1 line of code. Read on to find out more about this nifty little trick.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[18,13],"tags":[52],"class_list":["post-569","post","type-post","status-publish","format-standard","hentry","category-css-tips-and-tricks","category-tips-and-tricks","tag-css-tips"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/paBnQX-9b","jetpack_sharing_enabled":true,"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/posts\/569","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/comments?post=569"}],"version-history":[{"count":0,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/posts\/569\/revisions"}],"wp:attachment":[{"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/media?parent=569"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/categories?post=569"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/tags?post=569"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}