Tab焦点没有反映在Mozilla中

时间:2015-06-17 11:17:29

标签: html css model-view-controller

Tab关注以下元素在Mozilla中不起作用:

    <div class="editor-field">
                        <div>
                            <%: Html.TextBox(model => model.AddressLine1, new { maxLength = 30, style = "width:300px", tabindex = "0" })%>
                        </div>
<div class="editor-field">
                        <div>
                            <%: Html.TextBox(model => model.AddressLine2, new { maxLength = 30, style = "width:300px", tabindex = "0" })%>
                        </div>

<div class="editor-field">
                        <div>
                            <%: Html.TextBox(model => model.AddressLine3, new { maxLength = 30, style = "width:300px", tabindex = "0" })%>
                        </div>

我的CSS是:

editor-field > div > input:focus
{
     outline: 1px dotted red !important;
}

我可以知道我哪里错了。默认选项卡导航在Mozilla Firefox中不起作用。在Chrome和IE中运行良好。请帮我解决这个问题。

1 个答案:

答案 0 :(得分:0)

您必须使用Jquery或Javascript来设置焦点,如: -

$(document).ready(function() {
    $('.editor-field').first().children().children('input').focus();
});