{"id":58676,"date":"2016-01-11T05:05:42","date_gmt":"2016-01-11T10:05:42","guid":{"rendered":"http:\/\/www.templatemonster.com\/help\/?p=58676"},"modified":"2017-08-24T05:29:19","modified_gmt":"2017-08-24T09:29:19","slug":"magento-how-to-add-a-custom-css-file","status":"publish","type":"post","link":"https:\/\/www.templatemonster.com\/help\/magento-how-to-add-a-custom-css-file.html","title":{"rendered":"Magento. How to add a custom CSS file"},"content":{"rendered":"<p>\r\n<p>This tutorial describes how to add a custom CSS file in Magento.<\/p>\r\n<p><a href=\"http:\/\/www.youtube.com\/watch?v=K8idAm5lLSg?width=1280&amp;height=720\" rel=\"prettyPhoto\">Magento. How to add a custom CSS file<\/a><\/p>\r\n<p>In order to add a custom CSS file, you should perform the following changes:<\/p>\r\n<ol>\r\n<li>\r\n<p>Upload your custom CSS file to the server. The directory is as follows: <strong>skin\/frontend\/tm_themes\/themeXXX\/css<\/strong>:<\/p>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2015\/12\/Magento._How_to_add_a_custom_CSS_file.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2015\/12\/Magento._How_to_add_a_custom_CSS_file-300x169.jpg\" alt=\"Magento._How_to_add_a_custom_CSS_file\" width=\"300\" height=\"169\" class=\"aligncenter size-medium wp-image-58677\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/12\/Magento._How_to_add_a_custom_CSS_file-300x169.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/12\/Magento._How_to_add_a_custom_CSS_file-150x84.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/12\/Magento._How_to_add_a_custom_CSS_file.jpg 1000w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n\t<\/li>\r\n<li>\r\n<p>In order to make the CSS rules work, one should link the file to the template. Please navigate to <strong>app\/design\/frontend\/tm_themes\/themeXXX\/layout<\/strong> and edit <strong>local.xml<\/strong> file:<\/p>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2015\/12\/Magento._How_to_add_a_custom_CSS_file2.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2015\/12\/Magento._How_to_add_a_custom_CSS_file2-300x169.jpg\" alt=\"Magento._How_to_add_a_custom_CSS_file2\" width=\"300\" height=\"169\" class=\"aligncenter size-medium wp-image-58678\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/12\/Magento._How_to_add_a_custom_CSS_file2-300x169.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/12\/Magento._How_to_add_a_custom_CSS_file2-150x84.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/12\/Magento._How_to_add_a_custom_CSS_file2.jpg 1000w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n\t<\/li>\r\n<li>\r\n<p>Insert the following piece of code somewhere among the similar ones (it basically contains the relative path to your file):<\/p>\r\n<pre>\r\n\t\t&lt;action method=\"addCss\"&gt;&lt;stylesheet>css\/custom.css&lt;\/stylesheet&gt;&lt;\/action&gt;\r\n\t\t<\/pre>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2015\/12\/Magento._How_to_add_a_custom_CSS_file3.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2015\/12\/Magento._How_to_add_a_custom_CSS_file3-300x169.jpg\" alt=\"Magento._How_to_add_a_custom_CSS_file3\" width=\"300\" height=\"169\" class=\"aligncenter size-medium wp-image-58679\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/12\/Magento._How_to_add_a_custom_CSS_file3-300x169.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/12\/Magento._How_to_add_a_custom_CSS_file3-150x84.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2015\/12\/Magento._How_to_add_a_custom_CSS_file3.jpg 1000w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n\t<\/li>\r\n<li>\r\n<p>Save the changes.<\/p>\r\n<\/li>\r\n<\/ol>\r\n<div class=\"inline-banner\">\r\n<a href=\"https:\/\/www.templatemonster.com\/service-center\/\">\r\n<img src=\"\/help\/files\/banners\/inline\/Banner-2-(835-x100).jpg\"\/>\r\n<\/a>\r\n<\/div>\r\n<p>Feel free to check the detailed video tutorial below:<\/p>\r\n<p><a href=\"http:\/\/www.youtube.com\/watch?v=K8idAm5lLSg?width=1280&amp;height=720\" rel=\"prettyPhoto\">Magento. How to add a custom CSS file<\/a><\/p>\r\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>This tutorial describes how to add a custom CSS file in Magento.<\/p>\n","protected":false},"author":94,"featured_media":58680,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[729],"tags":[514,789,918,2407],"_links":{"self":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/58676"}],"collection":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/users\/94"}],"replies":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/comments?post=58676"}],"version-history":[{"count":2,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/58676\/revisions"}],"predecessor-version":[{"id":82932,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/58676\/revisions\/82932"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media\/58680"}],"wp:attachment":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media?parent=58676"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/categories?post=58676"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/tags?post=58676"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}