我在.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提供身份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';
}
感谢。
答案 0 :(得分:1)
试试这个:
@Html.ActionLink("LION TECHNOLOGIES", "Index", "Home", new { area = "" }, new { @class = "navbar-brand", @id = "navbar-text"})