procedure TFormHTMLText.FormShow(Sender: TObject);
const
CSS = 'p {'#13#10
+ ' margin-top: 0;'#13#10
+ ' margin-bottom: 0;'#13#10
+ '}';
var
StylesheetIndex: Integer;
Stylesheet: IHTMLStyleSheet;
begin
// Ein Navigate muss gemacht werden
WebBrowser1.Navigate('about
:blank');
FDocInterface := (WebBrowser1.Document as IHTMLDocument2);
LoadDocFromString(WebBrowser1, FHTMLString);
// CSS StyleSheet laden
StylesheetIndex := FDocInterFace.StyleSheets.Length;
if stylesheetIndex > 31 then
raise
Exception.Create(Lan('Maximal 32 Stylesheets erlaubt.'));
Stylesheet := FDocInterFace.createStyleSheet('', StylesheetIndex);
Stylesheet.cssText := CSS;
// String in Browser laden
LoadDocFromString(WebBrowser1, FHTMLString);
DesignMode(True);
end;