html - 在 IE 和 chrome 中截断(带 3 个点 "...")内容不起作用

标签 html css

我有以下情况:

HTML:

 <input class="BWForm_form-control BWTextBox" disabled="disabled" id="something" title="Test Firma" type="text" value="Test Firma 11111111111111111111111111111"></input>

CSS:

    // trunicate text with "..." 3 dots, if the content is larger than the current width
input[disabled="disabled"]{
    overflow:hidden; 
    white-space:nowrap; 
    text-overflow: ellipsis;
}

在 IE 和 chrome 中它不起作用,除了在 FireFox 中。

我也试过: text-overflow:ellipsis doesn't work on IE , text-overflow: ellipsis not working

但是没有影响..

如果没有固定宽度就好了,因为这些输入字段的宽度是不同的。

谢谢你的帮助

最佳答案

试试这个:

input[disabled="disabled"] {
    display: inline-block;
    max-width: 100px; /* Set a size */
    -ms-text-overflow: ellipsis;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    margin-top: 0px;
    padding-top: 0px;
}

关于html - 在 IE 和 chrome 中截断(带 3 个点 "...")内容不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24031987/

相关文章:

html - CSS: 表格 {宽度:100%;显示: block ;}在 Firefox 中不工作

javascript - 悬停 td 从悬停 tr 中逃脱背景颜色变化

HTML5 & Web 音频 api : Streaming microphone data from browser to server. 理想的传输和数据压缩

javascript - Slick carousel centerMode 的问题 - 不断增长的中心元素

html - 使用 Gulp 和缩小的 CSS/JS

css - 伪元素未在左上角对齐

CSS 3 奇怪的动画延迟

javascript - 如何在 Mediawiki 中启用站点的移动 View ?

php - 获得这项工作的任何替代解决方案? Php 代码无法正常工作,但 mysql 代码可以正常工作

javascript - 使用 fullPage.js 的部分之间的剪切路径转换