【发布时间】:2017-10-13 16:51:34
【问题描述】:
我在 .cshtml 文件中有一行代码:
@Html.ActionLink("LION TECHNOLOGIES", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
您可以看到文本 LION TECHNOLOGIES 已被赋予 navbar-brand 类。 Navbar-brand 是 bootstrap.css 中的一个类,我不想修改该文件,所以我想为 LION TECHNOLOGIES 分配一个 ID。如何为 LION TECHNOLOGIES 提供 ID navbar-text?
我试过这个:
@Html.ActionLink("LION TECHNOLOGIES", "Index", "Home", new { area = "" }, new { @class = "navbar-brand"}, new {@id = "navbar-text"})
但它给了我一个错误:
(当鼠标悬停在红色下划线上方时)
Argument 6: cannot convert from <anonymous type: string class>' to 'System.Web.Mvc.Ajax.AjaxOptions'
我正在尝试链接到我的 style.css 文件,我正在尝试将标题中的 LION TECHNOLOGIES 更改为 font-family。 Style.css 将如下所示:
@font-face {
font-family: 'plantagenet_cherokeeregular';
src: url('fonts/plantagenet_cherokee-webfont.woff2') format('woff2'),
url('fonts/plantagenet_cherokee-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;
}
#navbar-text {
font-family: 'plantagenet_cherokeeregular';
}
谢谢。
【问题讨论】:
标签: c# css asp.net-mvc twitter-bootstrap razor