Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi I can't change body style attribute (https://www.delphipraxis.net/83577-i-cant-change-body-style-attribute.html)

mr_fahrrad 4. Jan 2007 19:14


I can't change body style attribute
 
I need to change the body atribute style to background-attachment: fixed (to show background image)

Delphi-Quellcode:
IHTMldocument2(WebBrowser1.Document).body.setAttribute('style', 'background-attachment: fixed',0);
but it does not work!! the style cant change (dont alter body tag in source code), but if I type something like 'styleE' then the attribute 'styleE' appers in source code...

so.. how I make to chance style of body tag? (prefer using setAttribute)

Thanks!

mr_fahrrad 4. Jan 2007 19:20

Re: I can't change body style attribute
 
I found the solution:

Delphi-Quellcode:
WebBrowser1.OleObject.Document.Body.Style.cssText:='background-attachment: fixed';

The code above works


Alle Zeitangaben in WEZ +1. Es ist jetzt 14:29 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz