Forum for discussing general topics related to Couch.
3 posts Page 1 of 1
I have just integrated couchcms into a new site and using the richtext type and using
Code: Select all
<cms:show textname />
and all works good but it adds the opening and closing p tags which is fine but is is possible to add a css class to the p tag for individual pages for example I want the opening p tag to be
Code: Select all
<p class="text">
@ianhaney50, it is very tiresome to add classes inside richtext (requires switching to source). Maybe you could use this css trick instead? Like add an wrapping div and use it to find the inner p tag (could be all p tags or :first-child p tag or whatever your desired css) -
Code: Select all
<div class="text_wrapper"><cms:show textname /></div>

This can probably achieve what you need automatically.
trendoman wrote: @ianhaney50, it is very tiresome to add classes inside richtext (requires switching to source). Maybe you could use this css trick instead? Like add an wrapping div and use it to find the inner p tag (could be all p tags or :first-child p tag or whatever your desired css) -
Code: Select all
<div class="text_wrapper"><cms:show textname /></div>

This can probably achieve what you need automatically.


Thank you, I went with this way in the end
3 posts Page 1 of 1