1
我有一个字段集,看起来像这里面一个div:CSS绝对定位
<fieldset>
<legend>Device</legend>
<label id="select-6-container">
<select id="select-6" name="device_select" style="display:none"></select>
</label>
</fieldset>
<div id="ctrl">
<button type="button" id="restart1" name="button1" onclick="window.location.reload()" value="Restart Wizard">Restart Wizard</button>
<button type="button" id="gotostep2" class="gotostep2" name="button1" value="Next Step">Next Step</button>
</div>
我的选择框中,填入YUI,然后所示(请注意,其隐藏的负荷)。我对箱CSS是这样的:
#ctrl {
margin-top: 102px;
margin-left: -200px;
position: absolute;
width:100px;
}
但产生我的选择框时,按Ctrl箱下移每次!我有我的CSS错了吗?或者是因为选择框是在页面加载后由Javascript生成的?
我应该提到,当YUI将选择框呈现为菜单按钮时,它会将其标记更改为按钮,我不认为这应该很重要,因为ctrl的位置正是我想要改变的。
任何意见将有所帮助! 谢谢!
`div`可能呈现在另一个具有`position:relative`的元素内吗? – mVChr 2011-01-22 21:43:15