---
title: "css文字截断"
author: "felix_y"
date: "2013-08-15T19:17:37Z"
tags: []
categories: ["Web前端"]
slug: "css"
draft: false
lastmod: "2013-08-15T19:17:37Z"
id: 1925161
url: "https://yuebin.iteye.com/blog/1925161"
---

css文字截断

2012年10月31日

16:43

 

&lt;&lt;css文字截断测试.html&gt;&gt;

```
.img_info .info h6 a{ font-size:14px;
display: inline-block;
max-width:170px;
overflow: hidden;
white-space:nowrap;
text-overflow:ellipsis;
-o-text-overflow:ellipsis;
-moz-binding:url('ellipsis.xml#ellipsis');
}
```

 

&lt;&lt;ellipsis.xml&gt;&gt;

 

其中

 

-moz-binding:url('ellipsis.xml#ellipsis');

 

是针对老的firefox版本的写法

 

 

 

文字截断后在ie会出现一些比较奇怪的问题

 

解决办法一般为设置line-height,和height