我有一个带有 3 个按钮的简单工具栏(将来会有更多按钮。按钮上的文字无关紧要)。第一个问题是:我设置margin-left
和margin-right
设置工具栏like in the center of page
。如何在没有的情况下在页面中间(水平)设置工具栏margin-left/margin-right
?
第二个问题是:当我想调整页面大小时 - 工具栏在右侧留下了一些可用空间。
如何使工具栏看起来像这样?
这是页面的代码
<html>
<head>
<meta charset="utf-8">
<title>Hotel reservation</title>
<link rel="stylesheet" href="jquery-ui-themes-1.10.3/themes/ui-darkness/jquery-ui.css" />
<script src="jquery-ui-1.10.3/jquery-1.9.1.js"></script>
<script src="jquery-ui-1.10.3/ui/jquery-ui.js"></script>
<style>
#toolbar {
padding: 5px;
display: inline-block;
margin-left: 20%;
margin-right: 15%;
}
</style>
<script>
$(function() {
$( "#item1" ).button();
$( "#item2" ).button();
$( "#item3" ).button();
$( "#toolbar").autosize();
});
</script>
</head>
<body>
<div id="toolbar" class="ui-widget-header ui-corner-all ui-widget-content">
<input style="font-family: times new roman; type="button" id="item1" value="Общая информация"/>
<input style="font-family: times new roman; type="button" id="item2" value="Забронировать номер"/>
<input style="font-family: times new roman; type="button" id="item3" value="О нас"/>
</div>
</body>
</html>