gpt4 book ai didi

css - JQM 改变垂直位置

转载 作者:行者123 更新时间:2023-11-28 11:01:52 27 4
gpt4 key购买 nike

我对 JQMobile 有疑问。我有两个必须具有相同高度的 div,所以我在周围的 div 上使用了 display: table 并在我的内容周围使用了 display: table-cell。然而,问题是,虽然它适用于纯 HTML/CSS,但当我使用 JQM 时,它会变得困惑。

基本的代码结构是

<div style="display: table; width: 100%;">    
<div style="width: 49%; display: table-cell">
My content 1
</div>
<div style="width: 49%; display: table-cell">
My content 2
</div>
</div>

fiddle http://jsfiddle.net/liftarn/rt4nY/1/

最佳答案

好的,简单(但不是很明显的解决方案)是添加一个简单的 vertical-align:top as

<div style="display: table; width: 100%;">    
<div style="width: 49%; display: table-cell; vertical-align:top;">
My content 1
</div>
<div style="width: 49%; display: table-cell">
My content 2
</div>
</div>

关于css - JQM 改变垂直位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22405687/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com