- From: 一丝 via GitHub <sysbot+gh@w3.org>
- Date: Tue, 22 Apr 2025 14:55:13 +0000
- To: public-css-archive@w3.org
Another very common use case is that we usually want to display the ellipsis only when the text inside a Chinese book title exceeds the length. I think this also applies to other punctuation marks that appear in pairs.
```html
data:text/html;charset=UTF-8,<!DOCTYPE html>
<style>
    h2::before {
      content: "《";
    }
    h2::after {
        content: "》";
    }
    h2 {
        white-space: nowrap;
        overflow: hidden;
        width: 12em;
        text-overflow: ellipsis;
        text-overflow: "...》";
    }
</style>
<h2>编写可维护的JavaScript</h2>
```
Currently, we can do this with `text-overflow: “...” ` to achieve this effect indirectly, but this will lead to inaccurate width calculation. The fundamental solution is to exclude the clip `::before/after`.
Firefox:

-- 
GitHub Notification of comment by yisibl
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11253#issuecomment-2821606428 using your GitHub account
-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 22 April 2025 14:55:14 UTC