Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
I have found that thh rich text editor adds <p> tags to any text.

I can remove them but next time I save that page it readds them.

I am using cloned pages and when I pull the text out of the cms, I wrap it in <h2> tags and style in my css, but the styling gets lost because of the <p> tags.
I have tried some php to str_replace the <p> tags but cms:php doesnt recognise my php

does anyone have a solution or work around without addi9ng ectra styling in my css for
#subtext h2 p{...?

I have tried saving the text as normal<div> but that adds div tags
Barry, if you intend to use the inputted text within <H2> tags, I think you'd better use a simple 'text' or 'textarea' region. Richtext editors will always add some formatting of their own.

I'd like to add that you can use cms:nl2br tag for adding <BR/> to the text in 'textarea', if you decide to go with it.
What styles exacltly got broken?

if you defined margin or padding for <p>, you could use
h2 p {margin:0;padding:0}

if you defined a color or font style for p, you could use
h2 p {color: inherit; font-style: inherit; font-family: inherit}

It's also useful to define
h2 p {display:inline}

so your <h2><p></p></h2> will act like <h2><span></span></h2>.
3 posts Page 1 of 1
cron