The static image path in the img tag is assigned as /StaticFiles/Image/OutsideWebRoot.png. This path is the relative path after compilation, you can use to judge. Show an image of the map on the Blazor Canvas. How do I generate a random integer in C#? { You signed in with another tab or window. How to Use Static Images in a Blazor Application? Is it correct to use "the" before "materials used in making buildings are"? So you just use JavaScript interop to load the image, using sample code above. If you have the following setup in your site.CSS/app.CSS: Then in your page you can enclose everything in a div element and give it the class of page-background-class: Thanks for contributing an answer to Stack Overflow! For more information, please see our web assembly programs do not have direct access to browser events or the dom. 1 I tried to set background image for my div with codes below: background-image: url (../wwwroot/resources/images/LoginBackground.jpg); but it doesn't work, I try ' and " in url but it doesn't work also. How to protect API (from unexpected calls) with IdentityServer4? Bruce If blazor doesn't directly load the DOM objects then can we assume that. Obtain three images from any source or right-click each of the following images to save them locally. Here the image is obtained from {applicationFolder} /wwwroot/Image/InsideWebRoot.png. By clicking Sign up for GitHub, you agree to our terms of service and In this blog you will learn how to set Background Image throughout your webpage and display some text over it. Blazor Image component Image Demonstration and configuration of the Radzen Blazor Image component. section: Specify the background image in the