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
- Forum
- JCE Editor
- page background and CSS
Support is currently Online
Official support hours:
Monday To Friday
From 09:00 To 17:00 Europe/London (BST)
From 09:00 To 17:00 Europe/London (BST)
If I have Article1 and Article2 and need to use different page backgrounds I would want to use some CSS, right ?
How can I change page background for specific article ?
It's not actually possible to do this from within the editor, without additional HTML too, for example, to apply a background colour to the editor content, you would need to do something like:
<div style="background-color:#eee;">
// you content here
</div>
But this is a bit clunky, as how it looks in the front-end will depend on how the article is rendered by article manager and template. You will need to fiddle a bit to get this right. Also, you would ideally want to use a css class from your template instead of inline css, eg:
<div class="background-red">
// you content here
</div>
then in your template stylesheet, you could have:
.background-red {
background-color: #cc0000;
color: #fff;
}
Another way to do this is to use the itemid of the article (this is a number assigned to the article based on its menu assignment), so you can create a css rule in your template stylesheet targeting a sepecific article, eg:
.itemid-279 .item-page [itemprop="articleBody"] {
background-color: #eee;
padding: 1em;
}
Just because you're not paranoid doesn't mean everybody isn't out to get you.
- Page :
- 1
There are no replies made for this post yet.
Be one of the first to reply to this post!
Be one of the first to reply to this post!