ログインとサインアップのリンクまたはボタンを、ブラウザーウィンドウの右上の位置に固定したままにして、ラッパーdiv内に配置したい. しかし、ブラウザのウィンドウサイズを変更すると、ボタンが消えたり、ヘッダーの上に表示されたりします。
ULリストとヘッダーdivセクションを持つlogin_bar divセクションを持つHTMLコード
<div id="wrapper">
<div id="login_bar" style="text-align: right">
<ul id="login_signup">
<li><a href="#" id="login_link">Login <span>◀</span></a></li>
<li><a href="#" id="sign_link">SignUp <span>◀</span></a></li>
</ul>
</div>
<div id="header">
</div>
</div>
CSSファイル
#login_bar{
width:300px;
position:fixed;
z-index:10;
border:1px solid black;
top:-5px;
right:150px;
}
#header{
width:1000px;
background-image:url('../images/hf1.jpg');
background-size: 100%;
background-repeat: no-repeat;
position: relative;
border-radius:5px;
min-height: 100px;
}
#login_signup{
float:right;
}
#login_signup > li{
float:left;
padding-right: 30px;
list-style: none;
line-height:25px;
padding-top:6px;
display:inline-block;
}
#login_signup li > a{
font-family:sans-serif;
font-size: 17px;
font-weight: bold;
color:white;
padding:5px;
display:inlineblock;
background-color:black;
border-radius:5px;
-moz-border-radius:5px;
-webkit-border-radius: 5px;
-o-border-radius:5px;
box-shadow: rgb(0,0,0) 0px 0px 10px;
-moz-box-shadow: rgb(0,0,0) 0px 0px 10px;
-webkit-box-shadow: rgb(0,0,0) 0px 0px 10px;
-o-box-shadow:rgb(0,0,0) 0px 0px 10px;
}
#login_signup li span{
font-size: 12px;
display:inlineblock;
}
#login_signup li a:hover{
cursor: pointer;
box-shadow: rgb(255,255,255) 0px 0px 5px;
-moz-box-shadow: rgb(255,255,255) 0px 0px 5px;
-webkit-box-shadow: rgb(255,255,255) 0px 0px 5px;
-o-box-shadow:rgb(255,255,255) 0px 0px 5px;
border-radius: 2px;
background-color: white;
color:#006666;
}
両方の div セクションは、中央にあるラッパー div 内にあります
#wrapper{
width:1000px;
min-height:600px;
margin:5px auto;
border-radius:5px;
border-style: solid;
border:solid 1px grey;
box-shadow:rgb(0,0,0) 0px 0px 10px;
-moz-box-shadow: rgb(0,0,0) 0px 0px 10px;
-webkit-box-shadow: rgb(0,0,0) 0px 0px 10px;
-o-box-shadow:rgb(0,0,0) 0px 0px 10px;
background-color: black;
}