Css aspnetspell拼写错误导致不必要的换行 @使用ASPNetSpell; @{ ASPNetSpell.Razor.SpellAsyOutType MyAsyOutType=新的ASPNetSpell.Razor.SpellAsyOutType(); MyAsYouType.InstallationPath=(“/Content/ASPNetSpellInclude”); MyAsYouType.FieldsToSpellCheck=“搜索数据”; } @使用(Html.BeginForm(“搜索”、“主页”、新的{@class=“搜索框”})) { @Html.AntiForgeryToken() @TextBox(“Search_Data”,ViewBag.FilterValue作为字符串,new{@class=“Search box”}) @*@Html.Raw(MyAsYouType.getHtml())*@ }

Css aspnetspell拼写错误导致不必要的换行 @使用ASPNetSpell; @{ ASPNetSpell.Razor.SpellAsyOutType MyAsyOutType=新的ASPNetSpell.Razor.SpellAsyOutType(); MyAsYouType.InstallationPath=(“/Content/ASPNetSpellInclude”); MyAsYouType.FieldsToSpellCheck=“搜索数据”; } @使用(Html.BeginForm(“搜索”、“主页”、新的{@class=“搜索框”})) { @Html.AntiForgeryToken() @TextBox(“Search_Data”,ViewBag.FilterValue作为字符串,new{@class=“Search box”}) @*@Html.Raw(MyAsYouType.getHtml())*@ },css,asp.net-mvc,Css,Asp.net Mvc,上面的代码显示文本框旁边的图像。如果我取消对MyAsyOutType行的注释,则图像将下拉一行 该行正在添加元素。显示样式:块。如果我在chrome element inspector中删除此项,它将正确显示 我找不到覆盖此设置的位置 谢谢, 道格这是你的.cshtml: @using ASPNetSpell; @{ ASPNetSpell.Razor.SpellAsYouType MyAsYouType = new ASPNetSpell.Razor.SpellAsYouType();

上面的代码显示文本框旁边的图像。如果我取消对MyAsyOutType行的注释,则图像将下拉一行

该行正在添加元素。显示样式:块。如果我在chrome element inspector中删除此项,它将正确显示

我找不到覆盖此设置的位置

谢谢, 道格

这是你的.cshtml:

@using ASPNetSpell;
@{
    ASPNetSpell.Razor.SpellAsYouType MyAsYouType = new ASPNetSpell.Razor.SpellAsYouType();
    MyAsYouType.InstallationPath = ("/Content/ASPNetSpellInclude");
    MyAsYouType.FieldsToSpellCheck = "Search_Data";
}
<div id="searchbar">
    @using (Html.BeginForm("Search", "Home", new { @class = "search-box" }))
    {
        @Html.AntiForgeryToken()
        @Html.TextBox("Search_Data", ViewBag.FilterValue as string, new { @class = "search-box" })
        <input type="image" src="~/Images/Search.gif" alt="Find Everything Catholic" style="display:inline" />
        @*@Html.Raw(MyAsYouType.getHtml())*@
    }
</div>

这应该可以解决你的问题。

为什么不简单地添加你自己的CSS来覆盖它,而不是希望这个插件实际上有这个选项呢?我在.livespell\u textarea.ls\u input找到了它
<div id="searchbar">
    @using (Html.BeginForm("Search", "Home", new { @class = "search-box" }))
    {
        @Html.AntiForgeryToken()
        @Html.TextBox("Search_Data", ViewBag.FilterValue as string, new { @class = "search-box" })
        <input type="image" src="~/Images/Search.gif" alt="Find Everything Catholic" style="display:inline" />
        @*@Html.Raw(MyAsYouType.getHtml())*@
    }
</div>
.spellAsYouType { display: inline-block!important; }