You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

Support is currently Offline

Official support hours:
Monday To Friday
From 09:00 To 17:00 Europe/London (BST)

Please post your question in the Forum and we will get back to you as soon as we can.

  Monday, 17 July 2023
  10 Replies
  446 Visits
Hi,

I would like to create a custom css to add a background color on many paragraph, titles etc...

I don't something like this : https://www.screenpresso.com/=DNvAd

But I need a full background for all the lines/the section on all the page page width, with top and bottom margins.

How can I do that?

Thanks
L.
more than a month ago
·
#114236
Accepted Answer
If you want to apply the styles to a single container affecting a number of elements, rather to individual elements, then you can create a Custom Style that applies a <div> to the selected elements, with the same class you added to your custom.css file. For example,

In Editor Profiles -> Plugin Parameters -> Style Select, create a new Custom Style with the following values:

Title: Background Style Container
Tag: Div
Classes: background_styles (or whatever you name the style in your custom.css file)

Click Save, then open an article, select all the paragraphs etc. and select "Background Style Container" from the Styles list.

Using a css rule your custom.css file is better than using inline styles on an element as you can change the styles in the rule later without having to edit each article.

https://cdn.joomlacontenteditor.net/tmp/114206-custom-css-for-many-selectors.jpg

Just because you're not paranoid doesn't mean everybody isn't out to get you.

more than a month ago
·
#114221
any news?
more than a month ago
·
#114224
Assuming you want to apply a number of styles to a selection of block elements (paragraphs, headings etc.) then you can add a css file to your template stylesheet with the different styles, eg:


.background_styles {
bacgkround-color: #eee;
margin: 5px 0;
}


Then drag select the paragraphs etc. in the editor, and select "paragraph_styles" (or whatever you have called it) from the Styles list in the editor toolbar.

Just because you're not paranoid doesn't mean everybody isn't out to get you.

more than a month ago
·
#114227
If I add this css class for instance to my custom.css file, then it is not displayed in the styles list in the editor toolbar.
more than a month ago
·
#114229
Which template are you using?

Just because you're not paranoid doesn't mean everybody isn't out to get you.

more than a month ago
·
#114230
helix from joomshaper
more than a month ago
·
#114232

Just because you're not paranoid doesn't mean everybody isn't out to get you.

more than a month ago
·
#114233
ok after installing 2.9.39 RC :

- I see this https://www.screenpresso.com/=HYPMb
- but from editing mode I see this : https://www.screenpresso.com/=Oubkc
- and after saving article, from front-end (after exiting edit mode), I see this : https://www.screenpresso.com/=qaVyg => css class has not been applied


I have a specific css class for the page, is it a problem?
more than a month ago
·
#114234
sorry some cache was not deleted.

works fine, but css class is applied on each paragraph :

see here : https://www.screenpresso.com/=S8Wee

how can I remove white lines between each paragraph ?
or make the background color homogeneous without blank separation?

and what is the difference between adding css class inside custom.css file and using this screen https://www.screenpresso.com/=bHwqg ?
more than a month ago
·
#114236
Accepted Answer
If you want to apply the styles to a single container affecting a number of elements, rather to individual elements, then you can create a Custom Style that applies a <div> to the selected elements, with the same class you added to your custom.css file. For example,

In Editor Profiles -> Plugin Parameters -> Style Select, create a new Custom Style with the following values:

Title: Background Style Container
Tag: Div
Classes: background_styles (or whatever you name the style in your custom.css file)

Click Save, then open an article, select all the paragraphs etc. and select "Background Style Container" from the Styles list.

Using a css rule your custom.css file is better than using inline styles on an element as you can change the styles in the rule later without having to edit each article.

https://cdn.joomlacontenteditor.net/tmp/114206-custom-css-for-many-selectors.jpg

Just because you're not paranoid doesn't mean everybody isn't out to get you.

more than a month ago
·
#114242
perfect works fine, many thanks.
L.
toonetcreation selected the reply #114236 as the answer for this post — 4 months ago
  • Page :
  • 1
There are no replies made for this post yet.
Be one of the first to reply to this post!