1. Home
  2. Docs
  3. Liquid Web Shopify Coding...
  4. How to Use CSS on Shopify Section

How to Use CSS on Shopify Section

To use CSS on Shopify sections, follow these steps:

  1. Go to the Shopify admin panel and click on “Online Store” in the left-hand menu.
  2. Click on “Themes” at the top of the page and select the theme you want to edit.
  3. Click on “Customize” to open the Theme Editor.
  4. Click on the “Sections” tab in the left-hand menu to access the sections of your theme.
  5. Click on the section you want to edit and, in the right corner, menu, scroll down until you see this section:
  6. In the section editor, you will see a “Custom CSS” tab. Click on it to open the custom CSS editor.
  7. Enter your CSS code in the editor.
  8. Click on “Save” to apply your changes.

Note that any changes you make to the CSS will only affect that particular section. If you want to make changes to other sections or to the overall theme, you will need to edit those sections separately. Additionally, it’s always a good idea to make a backup of your theme before making any changes, just in case something goes wrong.

How to change the background color of a Shopify Section using CSS

In the CSS edit section we talked above, you can type “.” to and you will get a drop down menu showing you what elements can be customized using the code editor.

In our case, we are looking for the .banner class.

By typing in the following code, you can see the background color change to green. If you are using the Dawn theme, this exact code should work for you. If not, try a few different class names until you find the right element.

.banner{
background-color: green
}

Then, you can change the background color to whatever you like instead of “green” or use hex codes to find the exact color you need.

Here are some examples of CSS code that you can use in a Shopify theme:

  1. Change the background color of a section:
#section-id {
background-color: #f5f5f5;
}

Replace “section-id” with the actual ID of the section you want to change the background color of, and replace “#f5f5f5” with the color you want to use.

  1. Change the font size and color of text:
.text-class {
font-size: 18px;
color: #333333;
}

Replace “text-class” with the actual class of the text you want to change, and replace “18px” and “#333333” with the font size and color you want to use.

  1. Change the color and size of a button:
.button-class {
background-color: #ff0000;
color: #ffffff;
font-size: 16px;
padding: 10px 20px;
border-radius: 5px;
}

Replace “button-class” with the actual class of the button you want to change, and replace “#ff0000”, “#ffffff”, “16px”, “10px 20px”, and “5px” with the background color, text color, font size, padding, and border radius you want to use.

These are just a few examples of what you can do with CSS in a Shopify theme. There are many more possibilities, and you can customize your theme to match your brand and style.

How can we help?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.