Question How to set style for html properly with webbrowser control?

catdance

Member
Joined
Aug 5, 2009
Messages
13
Programming Experience
Beginner
I have tried function like htmldocment.setAttribute() and webbrowser.document.body.style="font-size:34px"

it's not always working, why?

for example

Dim a As HtmlElement
a = wb.Document.GetElementById("tableID")
a.SetAttribute("border", "3px")

worked, but not

Dim a As HtmlElement
a = wb.Document.GetElementById("tableID")
a.SetAttribute("style", "font-size:"24px")
 
try this:
VB.NET:
a.Style = "font-size:24px"
 
Well, I can confirm Document.Body.Style does not work, but when I get a node like TABLE/TR/TD or by id I can set Style.
 
Back
Top