Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
CSS text.overflow with@Html.LabelFor_Html_Css_Asp.net Mvc_Twitter Bootstrap - Fatal编程技术网

CSS text.overflow with@Html.LabelFor

CSS text.overflow with@Html.LabelFor,html,css,asp.net-mvc,twitter-bootstrap,Html,Css,Asp.net Mvc,Twitter Bootstrap,当我的bootstrap div列太小时,我想在@Html.LabelFor的末尾插入省略号 如果我使用静态文本,它会正确显示 洛雷姆ips 显示,但只要我使用@Html.LabelFor,它就会像 洛雷姆ips 没有。。。最后 随函附上我的密码:- <style> .hideOverflow { text-overflow: ellipsis; overflow: hidden; whi

当我的bootstrap div列太小时,我想在@Html.LabelFor的末尾插入省略号

如果我使用静态文本,它会正确显示

洛雷姆ips

显示,但只要我使用@Html.LabelFor,它就会像

洛雷姆ips

没有。。。最后

随函附上我的密码:-

    <style>
        .hideOverflow {
            text-overflow: ellipsis;
            overflow: hidden;
            white-space: nowrap;
            display: inline-block;
        }
    </style>

        <div class="row">
            <div class="col-md-1 hideOverflow">
                Lorem ipsum dolor sit amet, consectetur adipiscing elit.
@*                @Html.LabelFor(model => model.Balloon)*@
            </div>
            <div class="col-md-4">
                @Html.EditorFor(model => model.Balloon)
                @Html.ValidationMessageFor(model => model.Balloon)
            </div>
        </div>

.隐藏溢出{
文本溢出:省略号;
溢出:隐藏;
空白:nowrap;
显示:内联块;
}
Lorem ipsum dolor sit amet,是一位杰出的献身者。
@*@Html.LabelFor(model=>model.Balloon)*@
@EditorFor(model=>model.Balloon)
@Html.ValidationMessageFor(model=>model.Balloon)

任何帮助都将不胜感激。

@Html.LabelFor
将被呈现为
您应该为
编写css,而不是为
div

像下面这样的

.hideOverflow label{
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
        display: inline-block;
}