Concrete5 - Add CSS to a Block or Theme

In Concrete5 5.7 you can apply your own CSS to a page or even the whole site. Even without changing files directly on the server.

First you add some css to your theme

- go to your applied theme in "page design", and choose "Customize":

css_blog1.jpg

- besides changing all kind of colors, you'll find "Custom CSS" under "Advanced", click the icon:

css_blog2.jpg

- add a line with your own custom class and CSS: eg. ".mytheme_myclass { width: 50%; float:right; } (there are other ways to do this, just an example)

- or just add css to existing classes to override the theme:

css_blog3.jpg

- make sure to save, not only in the css dialog, but also to the theme (right bottom button). Apply to page or site

Now if you want your custom css for a block, you will have to add the class to your block

- in edit mode, hover on a block, and choose "Design & Custom Template"
- there will apear a menu on top of the block, choose "custom css classes, ...."
- enter the custom class of your choice, eg. "mytheme_myclass" (no leading '.'), hit enter and save

You may need to empty your cache and refresh your page.

1-1-2014

Blogs
Mar 1, 2016, 4:42 PM
Dec 7, 2015, 4:36 PM
May 9, 2015, 3:43 PM
Jan 1, 2014, 3:22 PM
Loading Conversation