Moosend

Disclosure: This website contains some affiliate links. When you click on these links and make a purchase, we may earn a commission at no additional cost at all to you. We only recommend products and services that we genuinely believe will provide value to our readers. Your support through these affiliate links helps us continue to provide valuable research and content. Thank you for your support!

Contents

Elementor Mastery: 50 CSS Snippets to Copy-Paste

CSS Snippets for elementor

Contents

We’re reader-supported. If you buy through links on our site, we may earn an affiliate commission at no extra cost to you at all. All of the commission comes from the brands themselves. This enables us to keep providing researched content. We appreciate your support!

In this comprehensive guide, we will explore common challenges faced by Elementor users and provide ready-to-use CSS code snippets to overcome them. Whether you’re a web designer, developer, or someone new to Elementor, this article will equip you with useful CSS Snippets to enhance your design workflow and create stunning websites with ease.

If you’re currently using Elementor’s free page-builder, it might be worth noting that a lot of the CSS below is easily achieved with Elementor Pro, without custom CSS.

Elementor Pro is just $59 a year, see for yourself – Elementor Pro Pricing

Not sure how CSS works? We’ve provided a short crash-course at the bottom of this page, scroll down or click here and you’ll be taken down magically automatically.

50 CSS Snippets

1. Remove the spacing between sections

Add the following CSS code to the Custom CSS area of the section:

.elementor-section {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

2. Change the font size of a specific heading widget

Add the following CSS code to the Custom CSS area of the heading widget:

.elementor-widget-heading h1 {
  font-size: 24px;
}

3. Center align a button within a column

Add the following CSS code to the Custom CSS area of the button widget:

.elementor-section {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

4. Remove the default bullet points from a list widget

Add the following CSS code to the Custom CSS area of the list widget:

.elementor-widget ul {
  list-style: none;
}

5. Change the background color of a section

Add the following CSS code to the Custom CSS area of the section:

.elementor-section {
  background-color: #f2f2f2;
}

6. Add a border to an image widget

Add the following CSS code to the Custom CSS area of the image widget:

.elementor-widget-image img {
  border: 1px solid #000000;
}

7. Change the text color of a specific paragraph

Add the following CSS code to the Custom CSS area of the paragraph widget:

.elementor-widget-text p {
  color: #ff0000;
}

8. Increase the spacing between columns in a section.

Add the following CSS code to the Custom CSS area of the section:

.elementor-section .elementor-column-gap-default > .elementor-row > .elementor-column {
  padding-left: 15px;
  padding-right: 15px;
}

9. Hide the navigation menu on mobile devices

Add the following CSS code to the Custom CSS area of the navigation menu:

@media (max-width: 768px) {
  .elementor-nav-menu {
    display: none;
  }
}

10. Increase the size of the social media icons in a widget.

Add the following CSS code to the Custom CSS area of the social media widget:

.elementor-widget-social-icons .elementor-icon {
  font-size: 24px;
}

11. Change the background color of the navigation menu.

Solution: Add the following CSS code to the Custom CSS area of the navigation menu:

.elementor-nav-menu {
  background-color: #333333;
}

12. Make the column background image fixed.

Add the following CSS code to the Custom CSS area of the column:

.elementor-column {
  background-attachment: fixed;
}

13. Remove the default spacing around an image widget.

Add the following CSS code to the Custom CSS area of the image widget:

.elementor-widget-image {
  margin: 0;
  padding: 0;
}

14. Change the color of a specific link in a paragraph.

Add the following CSS code to the Custom CSS area of the paragraph widget:

.elementor-widget-text a {
  color: #ff0000;
}

15. Increase the height of the section.

Add the following CSS code to the Custom CSS area of the section:

.elementor-section {
  min-height: 500px;
}

16. Make the columns stack vertically on mobile devices.

Add the following CSS code to the Custom CSS area of the section:

@media (max-width: 768px) {
  .elementor-section .elementor-row {
    flex-direction: column;
  }
}

17. Change the color of the button on hover.

Add the following CSS code to the Custom CSS area of the button widget:

.elementor-widget-button .elementor-button-wrapper:hover {
  background-color: #ff0000;
  color: #ffffff;
}

18. Increase the size of the video widget

Add the following CSS code to the Custom CSS area of the video widget:

.elementor-widget-video iframe {
  width: 100%;
  height: 400px;
}

19. Hide the section on mobile devices

Add the following CSS code to the Custom CSS area of the section:

@media (max-width: 768px) {
  .elementor-section {
    display: none;
  }
}

20. Change the background color of a specific column

Add the following CSS code to the Custom CSS area of the column:

.elementor-column {
  background-color: #f2f2f2;
}

21. Align the text to the right in a heading widget

Add the following CSS code to the Custom CSS area of the heading widget:

.elementor-widget-heading h1 {
  text-align: right;
}

22. Change the color of the text in a button widget

Add the following CSS code to the Custom CSS area of the button widget:

.elementor-widget-button .elementor-button-wrapper {
  color: #ff0000;
}

23. Remove the border around an image widget

Add the following CSS code to the Custom CSS area of the image widget:

.elementor-widget-image img {
  border: none;
}

24. Add a shadow effect to a section.

Add the following CSS code to the Custom CSS area of the section:

.elementor-section {
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

25. Change the color of the navigation menu links

Add the following CSS code to the Custom CSS area of the navigation menu:

.elementor-nav-menu a {
  color: #ff0000;
}

26. Increase the spacing between list items in a list widget

Add the following CSS code to the Custom CSS area of the list widget:

.elementor-widget ul li {
  margin-bottom: 10px;
}

27. Align the text to the center in a paragraph widget

Add the following CSS code to the Custom CSS area of the paragraph widget:

.elementor-widget-text p {
  text-align: center;
}

28. Change the font style of a specific heading

Add the following CSS code to the Custom CSS area of the heading widget:

.elementor-widget-heading h1 {
  font-family: Arial, sans-serif;
  font-style: italic;
}

29. Remove the padding around a column

Add the following CSS code to the Custom CSS area of the column:

.elementor-column {
  padding: 0;
}

30. Change the color of the icon in an icon widget.

Add the following CSS code to the Custom CSS area of the icon widget:

.elementor-widget-icon .elementor-icon i {
  color: #ff0000;
}

31. Make the section full-width

Add the following CSS code to the Custom CSS area of the section:

.elementor-section {
  max-width: 100%;
}

32. Add a border radius to an image widget

Add the following CSS code to the Custom CSS area of the image widget:

.elementor-widget-image img {
  border-radius: 50%;
}

33. Change the spacing between lines in a paragraph widget

Add the following CSS code to the Custom CSS area of the paragraph widget:

.elementor-widget-text p {
  line-height: 1.5;
}

34. Hide the page title on a specific page.

Add the following CSS code to the Custom CSS area of the page:

.elementor-page-title {
  display: none;
}

35. Change the color of the form field labels

Add the following CSS code to the Custom CSS area of the form widget:

.elementor-form label {
  color: #ff0000;
}

36. Increase the spacing between social media icons in a widget

Add the following CSS code to the Custom CSS area of the social media widget:

.elementor-widget-social-icons .elementor-icon {
  margin-right: 10px;
}

37. Change the font weight of a specific paragraph

Add the following CSS code to the Custom CSS area of the paragraph widget:

.elementor-widget-text p {
  font-weight: bold;
}

38. Add a background image to a section

Add the following CSS code to the Custom CSS area of the section:

.elementor-section {
  background-image: url('path/to/image.jpg');
  background-size: cover;
}

39. Change the color of the form submit button

Add the following CSS code to the Custom CSS area of the form widget:

.elementor-form .elementor-field-type-submit .elementor-button {
  background-color: #ff0000;
  color: #ffffff;
}

40. Add a border to a section

Add the following CSS code to the Custom CSS area of the section:

.elementor-section {
  border: 1px solid #000000;
}

41. Increase the size of the section content

Add the following CSS code to the Custom CSS area of the section:

.elementor-section .elementor-container {
  max-width: 1200px;
}

42. Change the font color of a specific heading

Add the following CSS code to the Custom CSS area of the heading widget:

.elementor-widget-heading h1 {
  color: #ff0000;
}

43. Make the text uppercase in a paragraph widget

Add the following CSS code to the Custom CSS area of the paragraph widget:

.elementor-widget-text p {
  text-transform: uppercase;
}

44. Add a background color to a specific column

Add the following CSS code to the Custom CSS area of the column:

.elementor-column {
  background-color: #f2f2f2;
}

45. Align the button to the right in a button widget

Add the following CSS code to the Custom CSS area of the button widget:

.elementor-widget-button .elementor-button-wrapper {
  text-align: right;
}

46. Change the font size of the form field labels.

Add the following CSS code to the Custom CSS area of the form widget:

.elementor-form label {
  font-size: 16px;
}

47. Add a background color to the navigation menu on hover.

Add the following CSS code to the Custom CSS area of the navigation menu:

.elementor-nav-menu a:hover {
  background-color: #ff0000;
}

48. Change the alignment of a specific column

Add the following CSS code to the Custom CSS area of the column:

.elementor-column {
  text-align: right;
}

49. Add a background color to a specific widget

Add the following CSS code to the Custom CSS area of the widget:

.elementor-widget {
  background-color: #f2f2f2;
}

50. Change the font style of the navigation menu

Add the following CSS code to the Custom CSS area of the navigation menu:

.elementor-nav-menu {
  font-family: Arial, sans-serif;
  font-style: italic;
}

A Beginner’s Guide to CSS

Our guide is below, but it might be worth starting with this video, it explains it in great detail.

Understanding Selectors, Classes, and IDs

CSS (Cascading Style Sheets) is a fundamental technology for styling and formatting web pages. It allows you to control the appearance of HTML elements, giving you the power to create visually appealing and consistent designs across your website.

With Elementor, it essentially creates the HTML and CSS for you when you drag and drop various widgets or import templates. However, custom CSS can be a great way to extend the functionality of the plugin further.

In this short guide, we’ll cover the basics of CSS, including how selectors, classes, and IDs work.

Introduction to CSS

CSS is a language that describes how thing written in HTML appear visually.

It works by applying rules to HTML elements. In this section, we’ll explain the purpose of CSS and how it is used to style HTML elements.

CSS Selectors

CSS selectors allow you to target specific HTML elements for styling. There are several types of selectors:

  1. Element Selectors: These target elements based on their HTML tag names. For example, the selector “p” targets all paragraphs in the document.
  2. Class Selectors: Classes are used to group elements that share a common style. To apply a class to an HTML element, you define a class name and use the class attribute. The selector “.classname” targets elements with a specific class. For example, “.highlight” targets all elements with the class “highlight”. In Elementor for example, you can add the class of any widget or block yourself, then the CSS you add with that class will apply to it.
  3. ID Selectors: IDs are used to uniquely identify specific elements. To apply an ID to an HTML element, you define an ID name and use the id attribute. The selector “#idname” targets the element with a specific ID. For example, “#header” targets the element with the ID “header”.
  4. Attribute Selectors: These selectors target elements based on their attribute values. For example, the selector “input[type=’text’]” targets all input elements with the attribute type set to “text”.

CSS Classes

CSS classes allow you to apply styles to multiple elements with a single declaration. To define a class, you create a CSS rule that starts with a dot followed by the class name. To apply a class to an HTML element, you add the class name as the value of the class attribute. For example:

.myclass {
  color: red;
}
<p class="myclass">This paragraph will be red.</p>

You can apply the same class to multiple elements, making it easy to maintain consistent styles throughout your website.

With Elementor, you can use Google Dev tools to find out the CSS Class and ID of anything on a webpage.

CSS IDs

Similar to classes, IDs are used to target specific elements for styling. However, IDs are unique within a page and should only be used for elements that appear once.

To define an ID, you create a CSS rule that starts with a hash followed by the ID name. To apply an ID to an HTML element, you add the ID name as the value of the id attribute. For example:

#myid {
  font-weight: bold;
}
<h1 id="myid">This heading will be bold.</h1>

IDs are typically used when you need to style a single unique element on a page.

That’s it! We could go all day on this, but at least you now know the basics. We advise heading to YouTube for more!

Recent Posts