[RESOLVED] style.css in webbrowser
I have one webbrowser and it isn't loading the .css of the page.. I set it to formload the index.html and inside the index.html I have entered the css inside the <style type="text/css">....</style> tags but then the browser only displays the html not the html formated by the style.
Help please.
Re: style.css in webbrowser
Anyone can help me please!
Re: style.css in webbrowser
How are you loading the page?
Code:
WebBrowser1.DocumentText =
or
Either way my bet is the browser can not resolve the path but if you had something like
Code:
WebBrowser1.Url = New Uri("http://kevininstructor.home.comcast.net/~kevininstructor/")
The browser has a path to resolve the css files. That is my take.
Re: style.css in webbrowser
vb Code:
WebBrowser1.Url = New Uri("http://myaddress.com/index.htm")
Didn't work :/
Re: style.css in webbrowser
Quote:
Originally Posted by
Acrobater
vb Code:
WebBrowser1.Url = New Uri("http://myaddress.com/index.htm")
Didn't work :/
What happens if you try
Code:
WebBrowser1.Url = New Uri("http://Google.com/")
Re: style.css in webbrowser
It loads ok. I also tried with other websites and they all loads the right way. I load mine on Mozilla and it loads the right way but once I add it to webbrowser it doesn't load the style.css :/ It only loads the images and the bg color, in IE it loads the same way as in vb.
@EDIT:
I have edited the HTML and now on IE it loads the right way but on webbrowser it won't load the right way :/
ALso... The site is being made using iWebKit.
Re: style.css in webbrowser
Please... help me please!!
1 Attachment(s)
Re: style.css in webbrowser
Quote:
Originally Posted by
Acrobater
Please... help me please!!
From what I mentioned before you can not get the web browser control to load an external css file if you are loading the HTML from a hard drive. In the attached project I show four different methods to load HTML and CSS.
Code button works because the css is embedded
Web button works because the web browser can resolve the css from the web.
Disk 1 button fails because loading html from disk the web browser control can not resolve a path for the css.
Disk 2 button works because the css in the html points to the same css in the web button code.
Unless I am missing something these are your options