我在RegisterConfirmation核心标识中搭建了我的.Net页面。我的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图像的宽度。当文本超过页面的宽度时,我可以选择它.
发布于 2020-07-18 11:24:03
与其说这是一个答案,不如说这是一个解决办法。通过使用换行器将我的文本按下页面,它工作得很好。对于大多数其他页面来说,这不是一个解决方案,但是因为这只是注册确认,页面上的组件很少,所以我可以让它工作。
我猜这是我的@section header_image的css大小问题。一种解决方案可能是检查css,或者创建一个高度降低的短消息头图像,并在这个页面上使用它。但我不需要在这件事上费心。
<body class="body-bg-img">
<div class="container-body">
<div class="row justify-content-center align-items-center">
<div class="col">
<br />
<br />
<h2 class="font-style-content-head" id="RegisterConfHeading">@_loc[Model.Heading]</h2>
<hr />
</div>
</div>
<br />
</div>
<br />
<br />
<br />
<br />
<br />
<br />
<div class="container-body">
<div class="row justify-content-center align-items-center">
@{
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>更新:上面的持续了大约60秒,我不能容忍它!:)这个问题是我的块标题css样式的硬编码高度值。我把它换成了汽车,现在没事了。仍然有一些整理,以得到全面的回首我的网页,但问题得到解决。
.block-title {
width: 520px;
height: auto;
text-align: center;
}https://stackoverflow.com/questions/62967649
复制相似问题