问题
我正在尝试在鼠标悬停时创建一个 loginForm 下拉菜单。表单从 miniLoginForm div 的左上角掉下,导致它从屏幕上掉下来。如何让它从 miniLoginForm div 的右上角下拉?
HTML
<li id="login"><?=anchor('users/login', 'Login')?>
<div id="miniLoginForm">
<?=form_open('users/login')?>
<p>Username: <?=form_input('username')?></p>
<p>Password: <?=form_password('password')?></p>
<p><?=form_submit('Login', 'Login')?></p>
<?=form_close()?>
<p>New User? <?=anchor('users/register', 'Click here')?></p>
</div>
</li>
CSS
#miniLoginForm {
margin: auto auto;
display: block;
border: 1px solid black;
width: 250px;
position: absolute;
}
nav {
width: 99%;
margin: 0 auto;
overflow:hidden;
text-align: center;
padding: 4px;
border: 2px solid black;
}
nav ul {
list-style-type: none;
margin: 0;
padding: 0;
}
nav ul li {
display: inline-block;
margin: 0 6px 0 3px;
}