c# - Remove attributes like width inside a style element -


i need remove width inside of style element, pref using html agility pack.

i tried using:

public static void removestyleattributes(this htmldocument html) {    var elementswithstyleattribute = html.documentnode.selectnodes("//@style");     if (elementswithstyleattribute!=null)    {       foreach (var element in elementswithstyleattribute)       {          element.attributes["style"].remove();       }    } } 

but have been unable target single element inside of style (since not want remove style entirely)


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -