我想在jQuery对话框内的两个按钮之间垂直居中或底部对齐文本。 我尝试了几种方法,但似乎都没有。 我在这里做错了什么?
我的代码如下:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Dialog - Default functionality</title>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/themes/ui-darkness/jquery-ui.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>
<script type="text/javascript">
$(function () {
$("#dialog_nav").dialog({
autoOpen: false,
modal: true,
dialogClass: "First_Dialog",
resizable: false,
buttons: [
{
text:"Login",
class:"Login_Class",
click: function () {
//
}
},
{
text:"SignUp",
class:"Sign_Up_Class",
click: function () {
//
}
}
]
});
$("#Dialog_Modal").on("click", function (event) {
$("#dialog_nav").dialog("open");
});
//$(".ui-dialog-buttonpane button:first").after('<span>Or</span>');
$(".ui-dialog-buttonset > button:first-child").css("float", "left");
$(".ui-dialog-buttonset > button:last-child").css("float", "right");
$(".Login_Class").after('<span class="Span_Text">Or</span>');
});
</script>
<style type="text/css">
.First_Dialog .ui-dialog-titlebar-close{
display:none;
}
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset
{
float:none;
}
.ui-dialog .ui-dialog-buttonpane
{
text-align:center;
}
span.Span_Text
{
text-align:center;
vertical-align:bottom;
}
</style>
</head>
<body>
<div id="dialog_nav" title="Basic Modal dialog">
<p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>
<input type="button" id="Dialog_Modal" value="Click to open a modeless dialog" />
</body>
</html>
答案 0 :(得分:0)