# CSS 排版技巧

## 文字排版

### 文本换行

单行文本长度超出后，末尾显示成 “...” ：

```css
.line-clamp-1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
```

多行文本长度超出后，最后一行末尾显示成 “...” ：

```css
/* Supported: Chrome6, Firefox68, Safari5, Opera15, Edge17 */
.line-clamp-3 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical; /* Non-standard */
  -webkit-line-clamp: 3; /* 3 lines */
}
```

## 参考文献

* [Line Clampin’ (Truncating Multiple Line Text)](https://css-tricks.com/line-clampin/)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://avincheng.gitbook.io/notebook/web/css/css-pai-ban-ji-qiao.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
