(Delphi XE)

(Delphi XE)
Using TWebBrowser to display a HTML-String with CSS.
Doing it like this:
(LDoc is a Variant and LHTML is a string with the HTML-Content which has the embedded CSS)
WebBrowser1.Navigate('about:blank');
LDoc := WebBrowser1.Document;
  LDoc.Clear();
  LDoc.Write(LHTML);
  LDoc.Close();

This works, however the CSS seems to be ignored? The HTML saved as file and opened in FireFox and InternetExplorer(on Windows 8.1) works fine.

The HTML is quite large, cant C&P it here.


EDIT: The HTML
http://pastebin.com/Jaq1UuwD

Comments

  1. Asbjørn Heid it's not that it ignores the CSS. It's just the CSS-Complexity in my example which requires IE9(Your source was quite simple and works below IE9 i suspect)

    ReplyDelete
  2. Alexander Benikowski Ah yes, still just found it weird that you said it worked fine when you saved it as a file, while not when you specified it directly. Oh well, learned something new :)

    ReplyDelete
  3. Asbjørn Heid seems i confused you, i opened the saved file in Firefox and IE ;)

    ReplyDelete

Post a Comment