由于旧版本显然对人们来说太难理解了,这里是 HTML、CSS 和 JavaScript 的组合:
$(document).ready(function() {
$('#test').dialog({
autoOpen: false,
modal: true
});
$("#test-link").click(function() {
$('#test').dialog('open');
});
});
div#main div#test label {
display: block;
}
div#main div#test input {
padding-left: 100px;
}
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script>
<div id="main">
<p><a href="#" id="test-link">test</a>
<p>
<div id="test" title="Submit Bug or Feature Request">
<form>
<label for="test_desc">Short Description:</label>
<input type="text" name="test_desc" id="test_desc" value="" />
<input type="submit" name="" value="Submit" />
</form>
</div>
</div>
对话框工作正常,但 CSS 不行。任何想法为什么?