div超过一定的高度和宽度自动省略

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<html>
<head>
    <style>
        html, body, p { margin: 0; padding: 0; font-family: sans-serif;}

        .ellipsis {
            overflow: hidden;
            height: 200px;
            line-height: 25px;
            margin: 20px;
            border: 5px solid #AAA; }

        .ellipsis:before {
            content:"";
            float: left;
             5px; height: 200px; }

        .ellipsis > *:first-child {
            float: right;
             100%;
            margin-left: -5px; }        

        .ellipsis:after {
            content: "2026";  

            box-sizing: content-box;
            -webkit-box-sizing: content-box;
            -moz-box-sizing: content-box;

            float: right; position: relative;
            top: -25px; left: 100%; 
             3em; margin-left: -3em;
            padding-right: 5px;
            
            text-align: right;

            background: -webkit-gradient(linear, left top, right top,
                from(rgba(255, 255, 255, 0)), to(white), color-stop(50%, white));
            background: -moz-linear-gradient(to right, rgba(255, 255, 255, 0), white 50%, white);            
            background: -o-linear-gradient(to right, rgba(255, 255, 255, 0), white 50%, white);
            background: -ms-linear-gradient(to right, rgba(255, 255, 255, 0), white 50%, white);
            background: linear-gradient(to right, rgba(255, 255, 255, 0), white 50%, white); }
    </style>
</head>
<body>
    <div class="ellipsis"><div>
        <p>Call me Ishmael.  Some years ago &ndash; never mind how long precisely &ndash; having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world.  It is a way I have of driving off the spleen, and regulating the circulation.  Whenever I find myself growing grim about the mouth; whenever it is a damp, drizzly November in my soul; whenever I find myself involuntarily pausing before coffin warehouses, and bringing up the rear of every funeral I meet; and especially whenever my hypos get such an upper hand of me, that it requires a strong moral principle to prevent me from deliberately stepping into the street, and methodically knocking people's hats off &ndash; then, I account it high time to get to sea as soon as I can.sldfjlsdjfdslf睡大觉了附近是否将老师大家乐福说了的减肥了电视剧数量大姐夫飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞凤飞飞收到了副驾驶的减肥两点开始讲课方式打开附件是大姐夫水电费了开始将打开师傅了大家是否就是打飞机时间到了副驾驶的房间就是大家乐福交水电费交水电费就是的减肥了开始大家算了宽带缴费时间的浪费就是的睡觉了打开附件了时空大姐夫开始的减肥老师看见到付款了尽快将姐姐姐姐就是了大家付款大大大大大大大大大大大大大大大大大大大大大大大大大大大大是大家分开了送到家附近了时打开附件是大家了圣诞节快乐飞机快乐的时间法律考试大姐夫是两块大姐夫开始交电费方式睡大觉了附近是否将老师大家乐福说了的减肥了电视剧数量大姐夫飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞凤飞飞收到了副驾驶的减肥两点开始讲课方式打开附件是大姐夫水电费了开始将打开师傅了大家是否就是打飞机时间到了副驾驶的房间就是大家乐福交水电费交水电费就是的减肥了开始大家算了宽带缴费时间的浪费就是的睡觉了打开附件了时空大姐夫开始的减肥老师看见到付款了尽快将姐姐姐姐就是了大家付款大大大大大大大大大大大大大大大大大大大大大大大大大大大大是大家分开了送到家附近了时打开附件是大家了圣诞节快乐飞机快乐的时间法律考试大姐夫是两块大姐夫开始交电士大夫士大夫费方式睡大觉了附近是否将老师大家乐福说了的减肥了电视剧数量大姐夫飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞飞凤飞飞收到了副驾驶的减肥两点开始讲课方式打开附件是大姐夫水电费了开始将打开师傅了大家是否就是打飞机时间到了副驾驶的房间就是大家乐福交水电费交水电费就是的减肥了开始大家算了宽带缴费时间的浪费就是的睡觉了打开附件了时空大姐夫开始的减肥老师看见到付款了尽快将姐姐姐姐就是了大家付款大大大大大大大大大大大大大大大大大大大大大大大大大大大大是大家分开了送到家附近了时打开附件是大家了圣诞节快乐飞机快乐的时间法律考试大姐夫是两块大姐夫开始交电费方式</p>    
    </div></div>
</body>
</html>
原文地址:https://www.cnblogs.com/hougelou/p/3354389.html