我正在尝试使字体粗体正常,而不是jquery mobile默认的粗体。
<div id="cont" data-role="fieldcontain">
<label for="select-choice-1" class="select">Choose shipping method:</label>
<select style="font-weight: normal" name="select-choice-1" id="select-choice-1">
<option value="standard">Standard: 7 day</option>
<option value="rush">Rush: 3 days</option>
<option value="express">Express: next day</option>
<option value="overnight">Overnight</option>
</select>
</div>
我尝试了内联样式和javascript
$('#select-choice-1').css("font-weight", "normal");
但没有成功,它仍然显示出大胆。请建议如何拆封。
http://jsfiddle.net/neilghosh/MECXW/6/
最佳答案
如果您使用firebug或类似工具检查呈现的页面,您将看到在运行时html结构与源html完全不同,这是由生成漂亮框的jquery ui提供的:
<span class="ui-btn-inner ui-btn-corner-all" aria-hidden="true">
<span class="ui-btn-text">Standard: 7 day</span>
<span class="ui-icon ui-icon-arrow-d ui-icon-shadow"></span>
</span>
要添加css规则来覆盖它:
#cont .ui-btn-text{font-weight:normal;}
id引用仅适用于此特定位置;如果要在任何地方应用普通字体粗细,请将其删除。小提琴:http://jsfiddle.net/MECXW/9/