{"id":2150,"date":"2018-12-17T11:07:51","date_gmt":"2018-12-17T03:07:51","guid":{"rendered":"https:\/\/www.baishitou.cn\/?p=2150"},"modified":"2018-12-17T11:07:51","modified_gmt":"2018-12-17T03:07:51","slug":"divcss%e8%b6%85%e5%87%ba%e9%95%bf%e5%ba%a6%e6%96%87%e5%ad%97%e8%87%aa%e5%8a%a8%e9%9a%90%e8%97%8f%e6%88%96%e7%94%a8%e7%9c%81%e7%95%a5%e5%8f%b7%e8%a1%a8%e7%a4%ba","status":"publish","type":"post","link":"https:\/\/www.baishitou.cn\/2150.html","title":{"rendered":"divcss\u8d85\u51fa\u957f\u5ea6\u6587\u5b57\u81ea\u52a8\u9690\u85cf\u6216\u7528\u7701\u7565\u53f7\u8868\u793a"},"content":{"rendered":"
\u6211\u4eec\u5728\u505a\u7ad9\u7684\u65f6\u5019\uff0c\u4e00\u4e9b\u533a\u57df\u7684\u6807\u9898\u6587\u5b57\u662f\u4e0d\u80fd\u6362\u884c\u7684\uff0c\u4f8b\u5982\u9996\u9875\u5217\u8868\u7684\u6587\u7ae0\u6807\u9898\uff0c\u56e0\u4e3a\u5e03\u5c40\u662f\u56fa\u5b9a\u7684\uff0c\u6362\u884c\u4f1a\u6253\u4e71\u5e03\u5c40\uff0c\u4ece\u800c\u4f7f\u7f51\u9875\u4ea7\u751f\u9519\u4f4d\u3002\u56e0\u6b64\uff0c\u6211\u4eec\u9700\u8981\u4e00\u884c\u4e00\u6bb5\u6587\u5b57\uff0c\u8d85\u51fa\u884c\u5bbd\u7684\u6587\u5b57\u7528\u7701\u7565\u53f7\u8868\u793a\u6216\u8005\u76f4\u63a5\u53bb\u6389\u4e0d\u7528\u7701\u7565\u53f7\u4ee3\u66ff\u3002\u770b\u770b\u4e0b\u56fe\u4e2d\u7684\u5b9e\u4f8b\u3002<\/p>\n
\u4e0a\u56fe\u663e\u793a\uff0c\u7ad9\u957f\u70ed\u8bc4\u5217\u8868\u91cc\u9762\u7684\u6587\u7ae0\u6807\u9898\uff0c\u8d85\u51fa\u884c\u5bbd\u7528\u7701\u7565\u53f7\u8868\u793a\u3002\u672c\u6587\u6211\u4eec\u5c31\u6765\u770b\u770b\u5982\u4f55\u7528css\u6765\u5b9e\u73b0\u7684\u3002<\/p>\n \u4e0a\u5217\u4ee3\u7801\u5404\u6807\u7b7e\u89e3\u91ca\uff1a<\/p>\n overflow: hidden white-space: nowrap text-overflow: ellipsis width:100px \u4e0a\u9762\u4ee3\u7801\uff0ctext-overflow\u7684\u5c5e\u6027\u503c\u662fclip\uff0c\u800c\u4e0d\u662fellipsis\u3002clip\u00a0\u8868\u793a\u4fee\u526a\u6587\u672c\u7684\u610f\u601d\u3002<\/p>\n<\/a><\/p>\n
css\u5b9e\u73b0\u8d85\u51fadiv\u957f\u5ea6\u7528\u7701\u7565\u53f7\u8868\u793a<\/strong><\/h2>\n
<div style=\"overflow: hidden; white-space: nowrap; text-overflow: ellipsis;width:150px;\" title=\"divcss\u8d85\u51fa\u957f\u5ea6\u6587\u5b57\u81ea\u52a8\u9690\u85cf\u6216\u7528\u7701\u7565\u53f7\u8868\u793a\">divcss\u8d85\u51fa\u957f\u5ea6\u6587\u5b57\u81ea\u52a8\u9690\u85cf\u6216\u7528\u7701\u7565\u53f7\u8868\u793a<\/div><\/code><\/pre>\n
\n<\/strong>overflow \u5c5e\u6027\u89c4\u5b9a\u5f53\u5185\u5bb9\u6ea2\u51fa\u5143\u7d20\u6846\u65f6\u53d1\u751f\u7684\u4e8b\u60c5\u3002\u8fd9\u4e2a\u5c5e\u6027\u5b9a\u4e49\u6ea2\u51fa\u5143\u7d20\u5185\u5bb9\u533a\u7684\u5185\u5bb9\u4f1a\u5982\u4f55\u5904\u7406\u3002hidden \u8868\u793a\u5185\u5bb9\u4f1a\u88ab\u4fee\u526a\uff0c\u5e76\u4e14\u526a\u6389\u7684\u5185\u5bb9\u662f\u4e0d\u53ef\u89c1\u7684\u3002<\/p>\n
\n<\/strong>\u89c4\u5b9a\u6587\u672c\u4e0d\u8fdb\u884c\u6362\u884c\u3002white-space \u5c5e\u6027\u8bbe\u7f6e\u5982\u4f55\u5904\u7406\u5143\u7d20\u5185\u7684\u7a7a\u767d\u3002nowrap \u8868\u793a\u6587\u672c\u4e0d\u4f1a\u6362\u884c\uff0c\u6587\u672c\u4f1a\u5728\u5728\u540c\u4e00\u884c\u4e0a\u7ee7\u7eed\uff0c\u76f4\u5230\u9047\u5230 <br> \u6807\u7b7e\u4e3a\u6b62\u3002<\/p>\n
\n<\/strong>text-overflow \u5c5e\u6027\u89c4\u5b9a\u5f53\u6587\u672c\u6ea2\u51fa\u5305\u542b\u5143\u7d20\u65f6\u53d1\u751f\u7684\u4e8b\u60c5\u3002ellipsis \u8868\u793a\u663e\u793a\u7701\u7565\u7b26\u53f7\u6765\u4ee3\u8868\u88ab\u4fee\u526a\u7684\u6587\u672c\u3002<\/p>\n
\n<\/strong>width \u5c5e\u6027\u8bbe\u7f6ediv\u7684\u957f\u5ea6\u3002<\/p>\ncss\u5b9e\u73b0\u8d85\u51fadiv\u957f\u5ea6\u7684\u6587\u5b57\u81ea\u52a8\u9690\u85cf<\/strong><\/h2>\n
<div style=\"overflow: hidden; white-space: nowrap; text-overflow: clip;width:100px;\" title=\"divcss\u8d85\u51fa\u957f\u5ea6\u6587\u5b57\u81ea\u52a8\u9690\u85cf\u6216\u7528\u7701\u7565\u53f7\u8868\u793a\">divcss\u8d85\u51fa\u957f\u5ea6\u6587\u5b57\u81ea\u52a8\u9690\u85cf\u6216\u7528\u7701\u7565\u53f7\u8868\u793a<\/div>\r\n<\/code><\/pre>\n