{"id":24549,"date":"2012-10-08T04:45:02","date_gmt":"2012-10-08T08:45:02","guid":{"rendered":"http:\/\/www.templatemonster.com\/help\/?p=24549"},"modified":"2017-08-16T09:38:45","modified_gmt":"2017-08-16T13:38:45","slug":"how-to-create-css-rules-for-specific-page-in-wordpress-joomla-and-drupal","status":"publish","type":"post","link":"https:\/\/www.templatemonster.com\/help\/how-to-create-css-rules-for-specific-page-in-wordpress-joomla-and-drupal.html","title":{"rendered":"How to create CSS rules for specific page in WordPress, Joomla and Drupal"},"content":{"rendered":"<p>\r\n<\/p>\r\n<p>\r\n\t\t\tSometimes it is very important to add class unique for only page but it is impossible without adding unique identifier.<br \/>\r\n\t\t\tIn this tutorial you will learn the way to create and use specific CSS class\/id to alter specific page for WordPress, Drupal and Joomla.\r\n\t\t<\/p>\r\n<ul>\r\n<li>\r\n<p>The first CMS we will inspect is <strong>Drupal<\/strong><\/p>\r\n<ol>\r\n<li>\r\n\t\t\t\tOpen Drupal admin panel and go to &#8220;Structure&#8221; menu on the top and the select &#8220;Pages&#8221;\r\n\t\t\t<\/li>\r\n<li>\r\n\t\t\t\tLocate the page you need to edit and press &#8220;edit&#8221; button on the right:<\/p>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_1.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_1-300x68.jpg\" alt=\"\" title=\"How_to_create_CSS_rules_for_specific_page_1\" width=\"300\" height=\"68\" class=\"alignnone size-medium wp-image-24550\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_1-300x68.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_1-150x34.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_1.jpg 923w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\r\n<\/li>\r\n<li>\r\n\t\t\t\tUpdate it by clicking the option you need and then &#8220;Edit&#8221; button on the right &#8211; you can see it on previous screenshot.\r\n\t\t\t<\/li>\r\n<li>\r\n\t\t\t\tClick &#8220;General&#8221; tab under &#8220;Variants&#8221; menu on the left:<\/p>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_2.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_2-290x300.jpg\" alt=\"\" title=\"How_to_create_CSS_rules_for_specific_page_2\" width=\"290\" height=\"300\" class=\"alignnone size-medium wp-image-24551\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_2-290x300.jpg 290w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_2-145x150.jpg 145w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_2.jpg 352w\" sizes=\"auto, (max-width: 290px) 100vw, 290px\" \/><\/a><\/p>\r\n<\/li>\r\n<li>\r\n\t\t\t\tType your new class in &#8220;Add body CSS classes&#8221; field, then press &#8220;Update&#8221; and &#8220;Save&#8221; buttons at the bottom to apply:<\/p>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_3.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_3-300x85.jpg\" alt=\"\" title=\"How_to_create_CSS_rules_for_specific_page_3\" width=\"300\" height=\"85\" class=\"alignnone size-medium wp-image-24552\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_3-300x85.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_3-150x42.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_3.jpg 751w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\r\n<\/li>\r\n<li>\r\n\t\t\t\tNow you can check your website with Firebug and make sure you have new unique identifier applied specifically for that page:<\/p>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_4.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_4-300x57.jpg\" alt=\"\" title=\"How_to_create_CSS_rules_for_specific_page_4\" width=\"300\" height=\"57\" class=\"alignnone size-medium wp-image-24553\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_4-300x57.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_4-150x28.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_4.jpg 1001w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\r\n<\/li>\r\n<\/ol>\r\n<\/li>\r\n<li>\r\n<p>\r\n\t\t\tThe next we will use <strong>Joomla<\/strong> and explain the way to add unique page ID.\r\n\t\t<\/p>\r\n<ol>\r\n<li>\r\n\t\t\t\tOpen Joomla admin panel and go to menu menager, then go to menu you use to open the page &#8211; regularly it is &#8220;Main menu&#8221; and click the button, for example if you need to edit &#8220;Contact us&#8221; page, then you need to open &#8220;Contact us&#8221; button.\r\n\t\t\t<\/li>\r\n<li>\r\n\t\t\t\tWhen you are in a specific menu button, press &#8220;Page Display Options&#8221; tab on the right panel:<\/p>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_5.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_5-300x271.jpg\" alt=\"\" title=\"How_to_create_CSS_rules_for_specific_page_5\" width=\"300\" height=\"271\" class=\"alignnone size-medium wp-image-24554\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_5-300x271.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_5-150x135.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_5.jpg 383w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\r\n<\/li>\r\n<li>\r\n\t\t\t\tYou need to add page class value, same as for Drupal you&#8217;ve just seen<\/p>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_6.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_6-300x40.jpg\" alt=\"\" title=\"How_to_create_CSS_rules_for_specific_page_6\" width=\"300\" height=\"40\" class=\"alignnone size-medium wp-image-24555\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_6-300x40.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_6-150x20.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_6.jpg 718w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\r\n<\/li>\r\n<li>\r\n\t\t\t\tPress &#8220;Save&#8221; button and it will be applied to your page. Now when you visit it new ID will be added.\r\n\t\t\t<\/li>\r\n<\/ol>\r\n<\/li>\r\n<li>\r\n<p>\r\n\t\t\tThe last CMS we inspect is <strong>WordPress<\/strong>\r\n\t\t<\/p>\r\n<ol>\r\n<li>\r\n\t\t\t\tIn WordPress CMS you do not need to add any unique identifier as it is added automatically by engine\r\n\t\t\t<\/li>\r\n<li>\r\n\t\t\t\tYou can use Firebug to locate it &#8211; check your body class:<\/p>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_7.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_7-300x56.jpg\" alt=\"\" title=\"How_to_create_CSS_rules_for_specific_page_7\" width=\"300\" height=\"56\" class=\"alignnone size-medium wp-image-24556\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_7-300x56.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_7-150x28.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2012\/09\/How_to_create_CSS_rules_for_specific_page_7.jpg 1001w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\r\n<p>\t\t\t\tYour page class will look like &#8220;page-page-id-&#8221; and a number singifying unique page ID assigned by system.\r\n\t\t\t<\/li>\r\n<\/ol>\r\n<\/li>\r\n<li>\r\n\t\tNow you know how to assign unique identifier so you can use it to set unqie style, gor example:<\/p>\r\n<pre class=\"brush:css\">\r\n\t\t\t.your_ID h2 {display:none;}\r\n\t\t<\/pre>\r\n<p>\t\tIt will hide all H2 instances for page with ID &#8220;your_ID&#8221;\r\n\t<\/li>\r\n<\/ul>\r\n<p>\r\n\t\t\tThank you for watching our video tutorials. Please contact us if you have any issues in editing your template. Good Luck!!!\r\n\t\t<\/p>\r\n<p>Feel free to check the detailed video tutorial below:<\/p>\r\n<p><a href=\"\/help\/files\/development\/How_to_create_CSS_rules_for_specific_page.htm\" target=\"blank\">How to create CSS rules for specific page in WordPress, Joomla and Drupal<\/a><\/p>\r\n<\/p>\r\n<p><\/p>\r\n<div class=\"inline-banner\">\r\n<a href=\"https:\/\/www.templatemonster.com\/cart.php?addOffer=587\">\r\n<img decoding=\"async\" src=\"\/help\/files\/banners\/inline\/Banner-1-(500-x100).jpg\" \/>\r\n<\/a>\r\n<\/div>","protected":false},"excerpt":{"rendered":"<p>In this tutorial you will learn the way to create and use specific CSS class\/id to alter specific page for Wordpress, Drupal and Joomla.<\/p>\n","protected":false},"author":29,"featured_media":24558,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[724,728,256],"tags":[514,572,710,1372],"class_list":["post-24549","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-joomla-tutorials","category-wordpress-tutorials","category-work-with-css","tag-css","tag-page","tag-rules","tag-specific"],"_links":{"self":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/24549","targetHints":{"allow":["GET"]}}],"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\/29"}],"replies":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/comments?post=24549"}],"version-history":[{"count":1,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/24549\/revisions"}],"predecessor-version":[{"id":82737,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/24549\/revisions\/82737"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media\/24558"}],"wp:attachment":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media?parent=24549"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/categories?post=24549"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/tags?post=24549"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}