3 つのボタンを備えたシンプルなツールバーがあります (将来的にはボタンが増える予定です。ボタンのテキストは関係ありません)。最初の問題は次のとおりです。ツールバーを設定しmargin-left
ます。なしでページの中央(水平)にツールバーを設定する方法は?margin-right
like in the center of page
margin-left/margin-right
2 番目の問題は次のとおりです。ページのサイズを変更したい場合、ツールバーの右側に空き領域が残ります。
ツールバーをこのようにするにはどうすればよいですか?
これがページのコードです
<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>