css如何设置鼠标悬停时每行显示的字数?

html-css07

css如何设置鼠标悬停时每行显示的字数?,第1张

案例

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>Document</title>

<style>

.box {

width: 900px

background-color: #eee

border: 1px dashed #ccc

margin: 0 auto

}

.top {

height: 80px

}

.banner {

height: 120px

/*margin: 0 auto*/

margin: 5px auto

}

.main {

height: 500px

}

.footer {

height: 100px

/*margin: 0 auto

margin-top:5px*/

margin: 5px auto 0

}

</style>

</head>

<body>

<div class="top box">top</div>

<div class="banner box">banner</div>

<div class="main box"></div>

<div class="footer box"></div>

</body>

</html>

找到控制字数,但是多余的他换行了,还是不方便。回答:说的也是。。要是用截取字符的方法又太麻烦而且。。不实用追问:.wth{width:150pxoverflow: hiddentext-overflow: ellipsiswhite-space: nowrapcourse:hand}多出的他不用 "..."而是换行了。很郁闷啊