Page 1 of 1

Custom css

Posted: Wed Sep 02, 2020 1:38 pm
by lodria
Hi!

I would like to ask how to add custom css when creating new content? For example, I want to set a shadow for an image, but only in the current writing. What solution is worth choosing?

Re: Custom css

Posted: Wed Sep 02, 2020 2:07 pm
by lightmat
I would create my own css file, and then make my own class for that use.

Re: Custom css

Posted: Wed Sep 02, 2020 2:31 pm
by Edi
1) You can set the style with the HTML tag

You can set the style with the HTML tag using style="...":

Example:

Code: Select all

<img src="https://mydomain.com/bl-content/uploads/pages/[...]" style="box-shadow: 10px 10px 15px silver">
2) Using own class

You can use an own class as for example shadow:

Code: Select all

<img src="https://mydomain.com/bl-content/uploads/pages/[...]" class="shadow">
In addition to this you have to give the class properties. For this you can use the plugin HTML Code.

Example:

Code: Select all

<style>
   box-shadow: 10px 10px 15px silver;
</style>

Re: Custom css

Posted: Wed Sep 02, 2020 5:11 pm
by lodria
Thanks! I will try what would be the best and easiest..
I searched ckeditor or another editor primarily for such opportunities because I write articles there, but I didn’t find anything like that in them.

Re: Custom css

Posted: Wed Sep 02, 2020 11:49 pm
by Edi
lodria wrote: Wed Sep 02, 2020 5:11 pm I searched ckeditor or another editor primarily for such opportunities because I write articles there, but I didn’t find anything like that in them.
CKEditor allows you to set the style or a classes at "Image properties" > "Advanced".

cke-image.png
cke-image.png (14.16 KiB) Viewed 2207 times

Re: Custom css

Posted: Thu Sep 03, 2020 5:06 pm
by lodria
They work, thank you again. All I would ask is is there a way to insert a larger css? Not one line, but more.

Re: Custom css

Posted: Thu Sep 03, 2020 10:16 pm
by Edi
lodria wrote: Thu Sep 03, 2020 5:06 pm They work, thank you again. All I would ask is is there a way to insert a larger css? Not one line, but more.
In this case I would use classes. It's better to separate the content from the styling, and easier to have all CSS in one place.