floating divs in list items

2019-08-02 19:44发布

I have a list with two <div>s in every <li> and I want to float them one next to the other and I want the <li> to take the whole availabe space. How do I do it?

<html>
    <head>
        <title></title>
        <style type="text/css">
            body {
            }
            ul {
            }
            li {
            }
            .a {
            }
            .b {
            }
        </style>
    </head>
    <body>
        <ul>
            <li>
                <div class="a">
                    content
                </div>
                <div class="b">
                    content
                </div>
            </li>
        </ul>
    </body>
</html>

7条回答
Bombasti
2楼-- · 2019-08-02 20:26
li { width: 100%;}
.a { float: left;}
.b { float: left;}
查看更多
登录 后发表回答