Here is the complete code for your reference:
In my current situation, I am creating an IHTMLDocument2 called currentDoc that points to DomDocument. I then write the appropriate string and close the currentDoc.
The program displays the HTML code correctly, including the CSS elements with 100% accuracy. Everything works as expected.
However, when I try to change the CSS from 2 columns to 3 columns by adjusting the width from 48% to 33% and run the code again with this new value, the CSS styles no longer apply.
If I close the program and then change the CSS back to 33%, it works perfectly fine. It seems like there might be a caching issue or conflict between the first and second set of CSS rules without disposing of the complete web browser instance.
I have searched extensively on the internet and on StackOverflow but couldn't find a solution to this specific problem. Therefore, I am posting it here in hopes of getting some guidance.