lauralee Posted December 1, 2010 Share Posted December 1, 2010 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 More sharing options...
Fmdpa Posted December 1, 2010 Share Posted December 1, 2010 You did "span=rd". It should be <span class="red"> Link to comment Share on other sites More sharing options...
lauralee Posted December 1, 2010 Author Share Posted December 1, 2010 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 More sharing options...
Fmdpa Posted December 1, 2010 Share Posted December 1, 2010 What is the value of $text? Click "view source" on your browser to check that it is not converted to html entities. Link to comment Share on other sites More sharing options...
lauralee Posted December 1, 2010 Author Share Posted December 1, 2010 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 More sharing options...
lauralee Posted December 1, 2010 Author Share Posted December 1, 2010 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 More sharing options...
thescientist Posted December 1, 2010 Share Posted December 1, 2010 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 More sharing options...
Fmdpa Posted December 2, 2010 Share Posted December 2, 2010 that still showed the class as rdThat's how it was referenced in the stylesheet. Link to comment Share on other sites More sharing options...
Ixzion Posted December 2, 2010 Share Posted December 2, 2010 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 More sharing options...
jeffman Posted December 2, 2010 Share Posted December 2, 2010 Ixzion is most likely correct. Link to comment Share on other sites More sharing options...
Fmdpa Posted December 2, 2010 Share Posted December 2, 2010 That's why I turn the cache completely off on my development browsers. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.