I'm currently working on ensuring that the background image stays within the user's window, regardless of the device being used. While I have successfully added the background image, I am facing challenges in centering it properly. The current outcome can be seen https://i.sstatic.net/1TLdQ.png. (Please ignore the navbar for now as I'm still new to web development)
I attempted a solution commonly used in other projects without success:
html {
background: url(/images/login.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
As this solution removed the entire background image, I removed it and focused on setting the background specifically within the main-content div.
<style>
.main-content {
background-image: url(/images/login.jpg);
}
</style>
How can I adjust the background size to fit the screen on any device?
If you'd like to review the code in Area/Identity/Pages/Account/Login.cshtml, here is the link: https://github.com/zhadjah9559/HelpDeskTicket/tree/4.MyTicketsView