Is it possible to change CSS in Webbrowser VB.NET?

Asked

Viewed 238 times

1

Hello, all good folks? my next question...

I want to disable all background-image so...

wanted to take the html of the whole page and put nothing in the tag "background-image" always leave empty.

in the pictures I got.. I studied and found

For Each img As HtmlElement In WebBrowser1.Document.Images
            img.SetAttribute("src", "")
            img.SetAttribute("style", "")
        Next

more in relation to css, I haven’t found a solution yet.

1 answer

3


To capture all page elements:

Dim todosElementos As HtmlElementCollection = WebBrowser1.Document.All

And change the style:

For Each elemento As HtmlElement In todosElementos
   elemento.Style = "background-image: none"
Next
  • I think the point is that the background can be in any element, not just the image type.

  • You’re right @mathiasfk ..

Browser other questions tagged

You are not signed in. Login or sign up in order to post.