我在网站上创建了一个可折叠的集,看起来像这样:
<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");
这是样式之前我的列表项的样子:
这是添加主题后的样子:
如您所见,每行之间的间距现在很大。我试图使用填充来更改CSS,但这并没有改变任何东西。有人能指出我正确的方向吗?
这是之前和之后的小提琴:
Before
After
最佳答案
您需要使用jQuery Mobile ThemeRoller升级theme-classic.css
。
<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>
关于javascript - 改变我的jQuery移动主题改变我的CSS样式,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/26987535/