c# - MVC 给 Identity/Account/Login 和 Identity/Account/Register Views 一个不同的 _Layout 页面
问题描述
我想将不同的 css 应用于页面正文加载到 MVC 堆栈中的默认 _Layout 文件中的位置。这是我希望在登录和注册页面中采用不同样式的部分。
<main role="main" class="container pb-3">
@RenderBody()
</main>
对于登录和注册页面,我希望这部分是这样的:
<main id="loginorregister" role="main" class="container pb-3">
@RenderBody()
</main>
因为新的id标签。我可以在wwwroot/css/site.css
. 我可以将此样式应用于“loginorregister”id 标签。
#loginorregister {
position: relative;
height: 100vh;
overflow: auto;
background-image: url("../img/pic.jpg");
background-size: cover;
background-position: center;
background-repeat: no-repeat;
background-attachment: fixed;
}
如您所见,布局页面看起来会有所https://localhost:5001/Identity/Account/Register
不同https://localhost:5001/Identity/Account/Login
我该怎么做?
解决方案
推荐阅读
- r-markdown - 在 pandoc 模板中获取第一作者 (Rmarkdown)
- clojure - Clojure:将原子的值设置为 true
- flutter - 如何在 Flutter 中设计卡片下方
- node.js - Redis 会话正在刷新来自 Angular HTTP GET 的每个新请求,但不是来自浏览器
- javascript - TypeError:无法读取未定义的属性“querySelector”
- javascript - 如何删除小数点后的最后两个数字?
- xamarin - 是否可以用纯 xamarin 按钮覆盖 Webview 按钮并单击它,同时单击网站按钮?
- android - google 把最新的 gradle 工具搬到哪里了
- vb.net - 在 vb.net 中创建文件到另一个位置
- python - 如何使用 NLTK 查找未大写的专有名词?