jquery - 在彼此之间列出元素jquery mobile

标签 jquery css jquery-mobile

我正在尝试制作一个小型聊天应用程序。列表项由 while 循环创建。现在消息有规律地彼此之间,但在这种情况下,它们在同一行中,直到站点宽度然后创建中断。我应该如何编辑 css 或添加列表项彼此之间的类?

<div style="height:100%; width:100%" data-role="content" id="container">
    <ul data-role="listview" data-inset="true" class="ui-listview ui-listview-inset ui-corner-all ui-shadow">
        <div style="width:100%" id="chatOutput">
    <li style="float: right; ;background-color:white;border-radius: 1em;" class="chatPost"><p class="stringSender"></p><p class="stringText">fd</p><p style="font-size:80%" class="stringTime">15:04:03</p></li>
    <li style="float: right; ;background-color:white;border-radius: 1em;" class="chatPost"><p class="stringSender"></p><p class="stringText">lala</p><p style="font-size:80%" class="stringTime">10:19:03</p></li>
        </div>
        </ul>
</div>

最佳答案

你可以试试看

clear : both;

关于jquery - 在彼此之间列出元素jquery mobile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34465339/

相关文章:

jquery - 单击 li 时添加值顶部选择选项

javascript - 如何将自定义属性分配给 jQuery 对象?

html - iOS 上双滚动的溢出隐藏问题

iOS 中的 jQuery Mobile 下拉菜单错误

jquery - 以编程方式更改 jQuery 选择选项 - 不起作用

jquery - 添加转换以隐藏/显示列表项

php - Jquery html() 而不是 val()

javascript - 如何在手机上立体观看3d html5/css3/native javascript页面?

jquery - 使用 Jquery 弹出图片库

css - jquery-mobile 标题右侧的两个图标彼此相邻