C#.NET: Change elements in a CSS file from dynamically generated HTML?

I have a C# code behind file that gets dynamically generated HTML from a server and converts it to a PDF. In the HTML there are `` elements that reference external stylesheets as well as many `` tags. All of these files, images and stylesheets, come from `www.example.com`, and I'm trying to make all elements come from `static.example.com` with the same url instead. I've used the obvious `stringName.Replace("www.example.com","static.example.com")` to replace the elements in the HTML, but is there any way to do so for the references in the CSS file? FOR EXAMPLE:
`background-image:url('www.example.com/bg.png');`
needs to become
`background-image:url('static.example.com/bg.png');`
in the external file. Any ideas on approach? Creativity is welcome; I'm up for anything! Thanks :)

以上就是C#.NET: Change elements in a CSS file from dynamically generated HTML?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » CSS3 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏