Jump to content

convert font tags to style?


astralaaron
 Share

Recommended Posts

I have a ton of old pages written out with stuff like this:

<font size="4"><b><u><font color="red">Chapter One</font></u></b></font><font size="3"><font color="black">Once upon a <b>time</b>....</font></font>

would it be possible to convert these to span tags with inline style? even just the font tags..

 

for example:

<span style="font-size:16px;font-weight:bold;color:red;text-decoration:underline;">Chapter One</style>or even<b><u><span style="font-size:16px;color:red;">Chapter One</style></b></u>
Link to comment
Share on other sites

 

I have a ton of old pages written out with stuff like this:

<span style="font-size:16px;font-weight:bold;color:red;text-decoration:underline;">Chapter One</style>

 

So you're gonna write a cool C# program to extract all the unique styles? I guess once you extract all the styles you could then sort them and factor them into the minimum number of classes, but as you demonstrate, you'd also need to compress common tags such as <b> and <strong> into styles.

Edited by davej
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...