background-image: url("images/background.jpg");
background-image: url("images/background.jpg");
We have applied an improvement that when ElementClassName is set, it will not preset the background color. This improvement will be in the next update.
Ok ... perfect
You need to add background.png to your project, then this PNG gets deployed to the output folder.
This was indicated in the browser console.
If you experience an issue, the browser console is the first place to look to see if there is an issue.
body{
background-image: url("background.png"); /* The image used */
background-color: white; /* Used if the image is unavailable */
background-position: center; /* Center the image */
background-repeat: no-repeat; /* Do not repeat the image */
background-size: cover; /* Resize the background image to cover the entire container */
background-attachment: fixed;
}
</style>
I DID run your project.
As soon as I added the background.png to the project, it got deployed in the output folder and the background was used in the main form.
<span class="fakeclass" style="z-index: 9999; box-shadow: silver 3px 3px 3px;">
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>TMS Web Project</title>
<style>
</style>
</span>
</span>
It is not form2 that has a white background color. When a new form is displayed, this is always displayed on top a window wide SPAN (to prevent clicks on controls of the form showing the new form).
It is as such this span that is white here while your CSS is only modifying the BODY element settings.
var spanList:TJSHTMLCollection;
i:Integer;
tmpstyle:string;
begin
spanlist:=document.getElementsByTagName('span');
for i:=0 to spanList.Length-1 do
begin
tmpstyle:=TJSElement(spanlist).getAttribute('style');
if(tmpstyle<>null)then
begin
tmpstyle:=StringReplace(tmpstyle,' background-color: white;','',[rfReplaceAll]);
TJSElement(spanlist).setAttribute('style',tmpstyle);
end;
end;
end;