我在网站上创建了一个可折叠集,看起来与此类似:
<div data-role="collapsible-set" id="result" style="margin: auto; padding-top: 50px; padding-bottom: 20px;">
<div>
<h2>
<span style="font-size: 16px; font-weight: bold; white-space: pre-wrap;" id="title' + num + '">abc</span><br>
<span style="font-size: 14px; font-weight: normal;" id="author' + num + '"></span>
<div style="font-weight: normal;">
<span style="font-style:italic; font-size: 13px;" id="journal' + num + '"></span>
</div>
</h2>
<div style="font-size: 14px;">
more info
</div>
</div>
</div>
然而,当我将主题应用于添加到可折叠集中的每个元素后,我的样式发生了变化,我不明白为什么。在我的可折叠集中添加 div 之前,我添加以下属性:
div.setAttribute("data-theme", "c");
这是我的列表项在设置样式之前的样子:
这是添加主题后的样子:
正如您所看到的,现在每行之间的间距相当大。我尝试使用 padding 更改 css 但没有改变任何内容。有人能指出我正确的方向吗?
这是小提琴前后的对比:
Before
After
你需要upgrade theme-classic.css
using jQuery Mobile ThemeRoller.
- Go to 下载页面并向下滚动到“旧版本"
- 1.3.2版本下-CSS开放使用默认主题解压缩:jquery.mobile-1.3.2.css,复制其内容。
- Go to jQuery Mobile ThemeRoller,从顶部工具栏中单击“导入或升级“。将打开一个新窗口
- 在该窗口中,粘贴 1.3.2 CSS 样式。从选择菜单中选择“升级至1.4.5版本”,然后单击“Import" button
- 检查复制的主题,根据需要进行更改。完成后,单击“Download”从顶部工具栏为您的主题指定自定义名称并下载升级的经典主题。
-
按以下顺序放置新主题和其他依赖项
<head>
<link rel="stylesheet" href="css/themes/my-custom-theme.css" />
<link rel="stylesheet" href="css/themes/jquery.mobile.icons.min.css" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile.structure-1.4.5.min.css" />
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
</head>
Demo
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)