Jump to content

restoring font color to its default


gabriel66
 Share

Recommended Posts

Dear AllWe are building a Visual Studio app. in which we give the user the ability to change the font color & background color of the HTML pages.the problem is how we can make the user restore the any color to its default -like the automatic color option in front page- we can't use "removeformat" as it removes all formats (super & sub script,...etc.) also we can't asume the default color is a specific one as the user may change the color of normal sytle in the CSS file.for example:

<p>Jackdaws love <font size="5" color="#800000"><span style="background-color: #00FFFF">my big sphinx</span></font> of quartz.</p>- remove the font color of the word (big):<p>Jackdaws love <span style="background-color: #00FFFF"><font size="5" color="#800000">my </font><font size="5">big</font><font size="5" color="#800000"> sphinx</font></span> of quartz.</p>-remove the backgrounf color of the word (big):<p>Jackdaws love <span style="background-color: #00FFFF"><font size="5" color="#800000">my </font></span><font size="5">big</font><span style="background-color: #00FFFF"><font size="5" color="#800000"> sphinx</font></span> of quartz.</p>

Thanks for your help

Edited by gabriel66
Link to comment
Share on other sites

Remove the elements that have that specific styling on them. If you're doing this with programming you either have to work with the DOM tree or do complex string parsing.

Link to comment
Share on other sites

Remove the elements that have that specific styling on them. If you're doing this with programming you either have to work with the DOM tree or do complex string parsing.
Dear IngolmeThanks for your reply. But as you can see in the example I've mentioned it's difficult to make the wanted changes.Anyway thanks and havr a nice day.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...