Jump to content

Format text


lauralee

Recommended Posts

I have an edit page that allows an administrator to do some simple edits like bold, italic, adding paragraphs, breaks and others, but I cannot get the color of the text to change using <span> I have it in my helpers include file as://[rd]red text $text = preg_replace('/\[rd](.+?)\[\/rd]/i', '<span="rd">$1</span>', $text);and in the css file as:span.rd {color:#ff0000;}But nothing happens. Is there a special coding I should know about for changing text color?

Link to comment
Share on other sites

That was a silly typo on my part. I now have it as: //[rd]red text $text = preg_replace('/\[rd](.+?)\[\/rd]/i', '<span class="rd">$1</span>', $text);but still no results.

Link to comment
Share on other sites

This is how it comes out on the source page, which is the way it should be, except that it isn't showing the text Police Dogs in red.<p><span class="rd">Police Dogs</span> </p>All the other formatting like bold, italic, new paragraph work properly. I've checked the css to make sure it is correct and that I have the stylesheet link correct. Anything else I should check?

Link to comment
Share on other sites

Well, I don't know what I did....But it seems to be working now. Maybe I didn't have the stylesheet referenced properly. Anyway, thanks for your replies.

Link to comment
Share on other sites

This is how it comes out on the source page, which is the way it should be, except that it isn't showing the text Police Dogs in red.<p><span class="rd">Police Dogs</span> </p>All the other formatting like bold, italic, new paragraph work properly. I've checked the css to make sure it is correct and that I have the stylesheet link correct. Anything else I should check?
that still showed the class as rd
Link to comment
Share on other sites

Well, I don't know what I did....But it seems to be working now. Maybe I didn't have the stylesheet referenced properly. Anyway, thanks for your replies.
I'm just throwing this out there, but you might have been viewing a cache of your document. Whenever I try to view a change in CSS, I always right-click on a page and select Reload (Firefox/Chrome) or Refresh (IE) in order for it to get a fresh view.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...