[英]Controlling ellipsis style in CSS
I implement Search in a web application that looks similar to the browser's "Find" feature. 我在看起来类似于浏览器“查找”功能的Web应用程序中实现了搜索。 I want to highlight the searched strings on the page.
我想突出显示页面上搜索到的字符串。 The search-string is often a substring of longer string that is shown with ellipsis.
搜索字符串通常是较长的字符串的子字符串,用省略号显示。
I want to highlight the search-string wherever it appears, and if it is found in the part of text replaced by ellipsis, then I want to highlight the ellipsis itself. 我想突出显示搜索字符串,无论它出现在什么地方,如果在用省略号代替的文本部分中找到它,那么我想突出显示省略号本身。
How can I do that? 我怎样才能做到这一点?
Use the following components to implement it: 使用以下组件来实现它:
overflow:hidden
container element overflow:hidden
容器元素 overflow:auto
content element overflow:auto
内容元素 position:absolute
highlight element position:absolute
高亮元素 A class attribute to get/set the state 用于获取/设置状态的类属性
Here are a few demos that comprise the aforementioned requirements: 以下是包含上述要求的一些演示:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.