css3 单行文字溢出,多行文字溢出
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style> .box{ width:200px; } .item{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } .mul-item{ overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp:2; -webkit-box-orient: vertical; } </style> </head> <body> <div class="box"> <p class="item">劝君更进一杯酒,西出阳关无故人。”冷月斜照,秋风萧瑟,枫叶飘落在浔阳江头</p> </div> <div class="box"> <p class="mul-item">寻寻觅觅,冷冷清清,凄凄惨惨戚戚。”诗意情怀的李清照,却着有更有韵情的宋词。李清照不仅有着“依门回首,却把青梅嗅。”娇柔妩媚;她还有着“至今思项羽,不肯过江东。”的洒脱豪放</p> </div> </body> <script> </script> </html>