【问题标题】:Setting background on Identity Manage Account page在身份管理帐户页面上设置背景
【发布时间】:2022-11-03 18:33:28
【问题描述】:

我正在尝试在 ASP.NET Core Web 应用程序的登录和管理帐户页面上设置背景图像 - 我正在使用身份 - (剃刀页面不是 MVC)但无论我将 css 放在哪里,它似乎都不会改变。

我尝试将其放在登录页面本身以及站点 css 上,但仍然没有。

它在我的其他页面上有效,但在这些页面上无效。

我的CSS如下:

`

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

`

【问题讨论】:

    标签: c# css asp.net-core razor-pages asp.net-core-razor-pages


    【解决方案1】:

    由于Logout页面在Identity区域下,所以背景图片的url为/Identity/hero-range-1.jpg,所以需要将图片放入wwwroot/Identity,这里有一个demo:

    图像根:

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

    区域/身份/页面/帐户/Login.cshtml:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-01-23
      • 2014-01-13
      • 2021-09-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多