Home > Blockchain >  Setting background on Identity Manage Account page
Setting background on Identity Manage Account page

Time:11-05

I am trying to set a background image on Login and Manage account pages for ASP.NET Core Web application - I'm using identity - (Razor pages not MVC) but it wont seem to change no matter where I put the css.

I tried putting it on the login page itself and also on the site css but still nothing.

It has worked on my other pages but not on these.

my css is as follows:

`

<style>
    body{
        background-image: url('hero-range-1.jpg');
        height: 100%;
        background-position: center;
        background-repeat: no-repeat;
        background-size: cover;
    }

`

CodePudding user response:

Since the Logout page is under Identity area,so the url of background image will be /Identity/hero-range-1.jpg,so you need to put the image into wwwroot/Identity,here is a demo:

image root:

/wwwroot/Identity/hero-range-1.jpg

Areas/Identity/Pages/Account/Login.cshtml:

...
<style>
    body{
        background-image: url('../hero-range-1.jpg');
        height: 100%;
        background-position: center;
        background-repeat: no-repeat;
        background-size: cover;
    }
</style>
  • Related