{"id":4284,"date":"2022-03-03T11:56:27","date_gmt":"2022-03-03T11:56:27","guid":{"rendered":"https:\/\/ibex.tech\/wordpress-sites\/?p=4284"},"modified":"2026-05-07T21:35:17","modified_gmt":"2026-05-07T20:35:17","slug":"custom-css-for-elements","status":"publish","type":"post","link":"https:\/\/ibex.tech\/wordpress-sites\/page-builders\/elementor\/css\/custom-css-for-elements","title":{"rendered":"Custom CSS for elements"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Setting custom CSS for an element<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Use &#8220;selector&#8221; in the Advanced &gt; Custom CSS box<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>selector {\n  opacity: 0.7;\n}<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>selector a {\n  font-weight: bold;\n}<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Changing based on screen width<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Elementor often applies your parameters like padding a div down from the flex container you are setting them on when it comes to displaying the page. If you apply @media settings for a smaller screen can have no effect as a result. An easy solution is set it for the worst case in elementor settings, then apply your change for a wider screen in the custom CSS, like this example of give me 100px padding if the screen is wide enough:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@media (min-width: 1601px)\n{\n  selector\n  {\n    padding-right: 80px !important;\n  }\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Setting custom CSS for an element Use &#8220;selector&#8221; in the Advanced &gt; Custom CSS box Changing based on screen width Elementor often applies your parameters like padding a div down from the flex container you are setting them on when it comes to displaying the page. If you apply @media settings for a smaller screen [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[354],"tags":[],"class_list":["post-4284","post","type-post","status-publish","format-standard","hentry","category-css"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/posts\/4284","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/comments?post=4284"}],"version-history":[{"count":3,"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/posts\/4284\/revisions"}],"predecessor-version":[{"id":4805,"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/posts\/4284\/revisions\/4805"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/media?parent=4284"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/categories?post=4284"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/wordpress-sites\/wp-json\/wp\/v2\/tags?post=4284"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}