CSS中强制ul li中的文字换行

                <!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
    li{
        display:block;
        float:left;
        width:40px;
        margin-right:8px;
        white-space:normal;
        word-break : break-all;
        word-wrap: break-word;
    }
</style>
</head>

<body>
    <div>
        <ul>
            <li>这里放置的是例子1</li>
            <li>这里放置的是例子2</li>
            <li>这里放置的是例子3</li>
            <li>这里放置的是例子4</li>
            <li>这里放置的是例子5</li>
            <li>这里放置的是例子6</li>
        </ul>
    </div>
</body>
</html>


           

再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.csdn.net/jiangjunshow

猜你喜欢

转载自blog.csdn.net/jdtugfcg/article/details/86483153