作者:双子汐晨_312 | 来源:互联网 | 2023-05-16 04:26
I have a structure like this:
我有这样一个结构:
This cell should has width 60% |
Hint
And ending of this string should be cutted out with ellipsis, no matter how long string will be
|
with css
用css
.one { width: 60%; }
.three {
display: none;
float: right;
}
.two:hover .three { display: block; }
.four {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
I want the left cell always has width of 60% and the right cell to take all other space. A long single-lined text in the right cell should be truncated with ellipsis, both when "hint" element is and isn't visible.
我希望左边的单元格的宽度是60%右边的单元格可以占据所有的空间。在正确的单元格中,当“提示”元素是或不可见时,应该使用省略号截断单行文本。
I've tried to use display: inline
, float: left
, position: absolute
, but didn't get any result that wouldn't ruin floating hint element at right side.
我尝试过使用display: inline, float: left, position: absolute,但是没有得到任何不会破坏浮动提示元素的结果。
jsFiddle here: http://jsfiddle.net/Z2kLV/1/
jsFiddle:http://jsfiddle.net/Z2kLV/1/
Also, solution doesn't have to be cross-browser, I need it only for chrome.
而且,解决方案不必是跨浏览器的,我只需要它用于chrome。
Please, help, I can't get this done
拜托,帮帮我,我做不到
1 个解决方案