[英]MVC working with CSHTML href
我的系统中有此cshtml部分布局视图
<div class="row" style="background: #816BFA; margin-left: 0; margin-right: 0; margin-top: 30px; height: 7%">
<h class="col-sm-4" style="text-align: center; font-size: 18px; color: black; height: 40px; top: 8px"><i class="glyphicon glyphicon-home"></i>@Html.ActionLink("Truck List","TruckList")// this</h>
<a href="index.html" class="col-sm-4" style="text-align: center; font-size: 18px; color: black; height: 40px; top: 8px"><i class="glyphicon glyphicon-book"></i> Reports</a>
<a href="index.html" class="col-sm-4" style="text-align: center; font-size: 18px; color: black; height: 40px; top: 8px"><i class="glyphicon glyphicon-user"></i> User Accounts</a>
</div>
输出是这个
您可能看不到文本"Truck List"
因为如果单击html.action链接,该链接始终变为蓝色。 是否有解决方案,可以像菜单中的其他文本一样将其变为黑色? 并且此链接重定向到操作“卡车清单”控制器“卡车”
替换下面的代码:
@Html.ActionLink("Truck List","TruckList")
有了这个:
Html.ActionLink(
"Truck List",
"Create",
CONTROLLERNAME,
null,
new { @style= "color: black;" }
)
只需添加以下CSS类:
h a {
color: black;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.