简体   繁体   English

在jQuery UI对话框中样式化元素

[英]Styling elements within a jQuery UI dialog

I have am attempting to add some input fields to a jquery ui dialog box and am having trouble applying styles to them. 我试图将一些输入字段添加到jquery ui对话框中,但无法将样式应用于它们。

Currently I have something like this: 目前我有这样的事情:

<div id="dgNew" title="New Client" >
<fieldset>
    <legend>Add a New Client</legend>
    <div><label class="left-lbl" for="clientCode">Code</label><input class="input-md" type="text" id="clientCode" name="Code" disabled="true" /></div>
    <div><label class="left-lbl" for="ClientName">Client Name</label><input class="input-md required" type="text" id="ClientName" name="ClientName" /></div>
</fieldset>

The css I have to style this is not getting picked up. 我必须设置样式的CSS不会被拾取。 If I move the fields to just display on the page (not in the dialog) then the styles I have applied to left-lbl, right-lbl, etc. get picked up fine. 如果我将字段移动到仅显示在页面上(而不是在对话框中),那么我应用于left-lbl,right-lbl等的样式就会变得很不错。

If I examine the dialog in firebug the styles are there on the elements but do not show as having been applied. 如果我检查萤火虫中的对话框,则样式存在于元素上,但未显示为已应用。 Is there something I need to do specific to jquery ui to make this work? 我需要针对jquery ui进行一些特定的操作以使其工作吗?

Ok, problem solved. 好,问题解决了。 This was just a stupid mistake on my part. 对我而言,这只是一个愚蠢的错误。 I had the style applied to all class within a wrapper div on my page but the dialog's div is declared outside of the wrapper and so it wasn't picking them up. 我已经将样式应用于页面上的包装div中的所有类,但是对话框的div在包装的外部声明,因此没有选择它们。

#wrap label.left-lbl

instead of just 而不只是

label.left-lbl

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM