【发布时间】:2020-11-08 01:36:58
【问题描述】:
我已经在 .Net Core 身份中搭建了我的 RegisterConfirmation 页面。我的cshtml代码如下。
@page
@model RegisterConfirmationModel
@using LazZiya.ExpressLocalization
@inject ISharedCultureLocalizer _loc
@{
ViewData["Title"] = _loc[Model.PageTabTitle];
}
@section header_image{
<div class="bg-img-non-home" id="RegisterPageBanner">
}
@section header_content{
<div class="container-title">
<div class="block-title">
<br>
<h1 class="block-subtitle-text" id="RegisterPageSubtitle">@_loc[Model.SubTitle]</h1>
<h2 class="block-title-text-non-home" id="RegisterPageTitle">@_loc[Model.Title]</h2>
</div>
</div>
}
</div>
<body class="body-bg-img">
<div class="container-body">
<div class="row justify-content-center align-items-center">
<div class="col">
<br />
<h2 class="font-style-content-head" id="RegisterConfHeading">@_loc[Model.Heading]</h2>
<hr />
</div>
</div>
<br />
</div>
<div class="container-body">
<div class="row justify-content-center align-items-center">
<hr />
@{
if (@Model.DisplayConfirmAccountLink)
{
<p>
This app does not currently have a real email sender registered, see <a href="https://aka.ms/aspaccountconf">these docs</a> for how to configure a real email sender.
Normally this would be emailed: <a id="confirm-link" href="@Model.EmailConfirmationUrl">Click here to confirm your account</a>
</p>
}
else
{
<p>
Please check your email to confirm your account.
</p>
}
}
</div>
</div>
</body>
如果@section header_content 存在,页面上的所有内容都会显示。但是我的if 语句中的文本无法用鼠标突出显示,并且无法单击a href 链接。如果我删除下面的代码部分,那么我的 if 语句中的文本可以使用鼠标突出显示,并且 href 可以正常工作。
@section header_content{
<div class="container-title">
<div class="block-title">
<br>
<h1 class="block-subtitle-text" id="RegisterPageSubtitle">@_loc[Model.SubTitle]</h1>
<h2 class="block-title-text-non-home" id="RegisterPageTitle">@_loc[Model.Title]</h2>
</div>
</div>
}
</div>
更新:当我放大时它工作正常。此外,如果我在 if 语句中添加大量文本,它不会换行,它只会超过 body-bg-img 图像的宽度。当文本超过页面宽度时,我可以选择文本...
【问题讨论】:
-
看起来您正在使用引导程序。您可以使用'fixed-top'锚定顶部图像getbootstrap.com/docs/4.1/components/navbar/#placement
标签: asp.net-core razor razor-pages