一連のボタンを含む上部にバナーのあるページをコーディングしています。次のコードはすべてで機能しますが、ボタンが並んで表示されるときに改行が行われます。div は自動的に新しい行を取得し、スパンを使用する必要があることは知っていますが、使用すると、div の場合のようにボタンに合わせてバナーが引き伸ばされません。float のいくつかのバリエーションを使用してみましたが、役に立ちませんでした。
<style type="text/css" media=screen>
body{
margin: 0px;
padding: 0px;
color: #000;
font-family: helvetica, times;
font-size: 14px;
}
#wrapper{
position: absolute;
height: 100%;
width: 100%;
text-align:center;
}
#banner{
background: url('images/banner_background.png');
position: relative;
margin: 0;
width: 100%;
color: #FFFFFF;
z-index: 3;
}
#banner #button {
padding:10px;
margin:auto;
position: relative;
background: url('images/button.png');
height: 100%;
z-index: 4;
width:100px;
}
</style>
</head>
<body>
<div id="wrapper">
<div id="banner">
<div id="button">
dfsdfsfdsdfs
</div>
<div id="button">
sddfdfdsf
</div>
</div>
</div>